designing effective graphics using matlab
DESCRIPTION
Designing Effective Graphics Using MATLAB. The Cain Project in Engineering and Professional Communication ENGINEERING SERIES. The Purpose of Using Graphics. In your own problem solving As part of design As analysis of operating data For persuasion and interpretation - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/1.jpg)
Designing Effective Graphics Using MATLAB
The Cain Project in Engineering and Professional Communication
ENGINEERING SERIES
![Page 2: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/2.jpg)
The Purpose of Using Graphics
• In your own problem solving– As part of design– As analysis of operating data
• For persuasion and interpretation– Dramatize relationships– Promote identification– Make complex information accessible
![Page 3: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/3.jpg)
Criteria for Good Graphics
• Purpose clear?
• Pattern and arrangement lead eye without distraction?
• Similar items grouped and indicated?
• Graphic hierarchy consistent?
• Fonts legible?
![Page 4: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/4.jpg)
Criteria for Good Graphics (contd.)
• Critical components defined?
• Essential calculations behind claims shown?
• Any significant reference or standard omitted?
• Presenters’ expertise demonstrated?
![Page 5: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/5.jpg)
Types of Graphics in Matlab
• Line graph– 2D– 3D
![Page 6: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/6.jpg)
Types of Graphics in Matlab
• Column or
bar graph
![Page 7: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/7.jpg)
Types of Graphics in Matlab
• Pie graph– Shows “whole to
part” relationships
![Page 8: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/8.jpg)
Types of Graphics in Matlab
• Ribbon graph
![Page 9: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/9.jpg)
Select Right Type of Graphic
• What Is Your Purpose?– Problem solving?– Persuasion and interpretation?
• Who Is the Audience?– What are their backgrounds?– What do they want to know?
• What Is the Context?– Presentation?– Report/Paper?
![Page 10: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/10.jpg)
Context Affects Graph Qualities
• Presentation– Big titles, labels, etc.– Can use any color– Can use animation
• Report– Smaller titles, labels, etc.– Often just black and white– Animation impossible
![Page 11: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/11.jpg)
2D Plot Tips
• Use the best line style/size for the situation.
• Think about the best placement of legend/key.
• Incorporate error bars, if necessary.
• Use gridlines sparingly.
![Page 12: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/12.jpg)
An Example
• You have:– Vector 1: x(0:0.2:10);– Vector 2: sin(x);– Vector 3: cos(x);
• You are asked to:
– Plot sin(x) vs. x and cos(x) vs. x in the same figure.
– Customize the figure so that it is suitable for presentation.
![Page 13: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/13.jpg)
A Simple Matlab Program
clear all;X=[0:0.2:10];sinx=sin(x);cosx=cos(x);plot(x,sinx,x,cosx);xlabel('x');ylabel('y');title([‘sin and cos Functions']);
![Page 14: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/14.jpg)
Default Plot Given by Matlab
0 1 2 3 4 5 6 7 8 9 10-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x
y
sin and cos Functions
![Page 15: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/15.jpg)
We Want …
• Titles and labels bigger
• Lines thicker
• Colors more contrasting
• Key data points visible
• Legend or labels close to lines
![Page 16: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/16.jpg)
How to Get What We Want
![Page 17: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/17.jpg)
Open the Property Editor
![Page 18: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/18.jpg)
Edit Figure Properties
![Page 19: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/19.jpg)
Edit Axes Properties
![Page 20: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/20.jpg)
Edit Line Properties
![Page 21: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/21.jpg)
So Far, A Better-Looking Figure
0 2 4 6 8 10-1
-0.5
0
0.5
1
x
y
sin and cos Functions
![Page 22: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/22.jpg)
Insert Legend
![Page 23: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/23.jpg)
Edit Legend Properties
![Page 24: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/24.jpg)
Insert Y Grid Line
![Page 25: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/25.jpg)
Final Version!
0 2 4 6 8 10-1.5
-1
-0.5
0
0.5
1
1.5
x
y
sin and cos Functionssin(x)cos(x)
![Page 26: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/26.jpg)
Frequently Used Functions
• “plot”• “xlabel”, “ylabel”• “title”• “xlim”, “ylim”• “axis”• “legend”• “errorbar”
Type “help xxx” in Matlab command window for detailed information on the usage of the function xxx.
![Page 27: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/27.jpg)
Other 2D Plotting Commands
• “loglog”: graph with logarithmic scales for both axes.• “semilogx”: graph with a logarithmic scale for x-axis
and a linear scale for y-axis.• “semilogy”: graph with a logarithmic scale for y-axis
and a linear scale for x-axis.• “plotyy”: graph with y-tick labels on the left and right
side.
![Page 28: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/28.jpg)
A Whole Lot More …
• 2D contour– “contour”– “contourslice”
• 3D plots– “plot3”– “mesh”– “surf”
• Movie– “getframe”– “movie”
![Page 29: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/29.jpg)
Plotting in Excel
![Page 30: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/30.jpg)
Selecting Chart Type and Inputting Data
![Page 31: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/31.jpg)
Adding Labels and Selecting Location
![Page 32: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/32.jpg)
What do we need to change?
![Page 33: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/33.jpg)
Formatting your Chart
![Page 34: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/34.jpg)
Adding a Trendline
![Page 35: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/35.jpg)
Formatting the Data
![Page 36: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/36.jpg)
Editing the Line and Markers
![Page 37: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/37.jpg)
Formatting the Font
![Page 38: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/38.jpg)
Final Product!
![Page 39: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/39.jpg)
Other Features
• Logarithmic axis– Select the axis you want to change– Right click or select the “Format” option in
your toolbar and select “Format Axis”– Click on the “Scale” tab– Check the box marked “Logarithmic
Scale”
![Page 40: Designing Effective Graphics Using MATLAB](https://reader035.vdocuments.site/reader035/viewer/2022062408/56813b9c550346895da4d16d/html5/thumbnails/40.jpg)
More resources are available for you
• under “Engineering Communication” at Connexions at http://cnx.org
• at the Cain Project site at http://www.owlnet.rice.edu/~cainproj
• in your course Communication Folder in OWLSPACE.
Lead through Excellence in Engineering Communication