Title: Designing Effective Graphics Using MATLAB
1Designing Effective Graphics Using MATLAB
The Cain Project in Engineering and Professional
Communication ENGINEERING SERIES
2The 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
3Criteria for Good Graphics
- Purpose clear?
- Pattern and arrangement lead eye without
distraction? - Similar items grouped and indicated?
- Graphic hierarchy consistent?
- Fonts legible?
4Criteria for Good Graphics (contd.)
- Critical components defined?
- Essential calculations behind claims shown?
- Any significant reference or standard omitted?
- Presenters expertise demonstrated?
5Types of Graphics in Matlab
6Types of Graphics in Matlab
7Types of Graphics in Matlab
- Pie graph
- Shows whole to part relationships
8Types of Graphics in Matlab
Ribbon graph
9Select 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?
10Context 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
112D 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.
12An Example
- You have
- Vector 1 x(00.210)
- 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.
13A Simple Matlab Program
- clear all
- X00.210
- sinxsin(x)
- cosxcos(x)
- plot(x,sinx,x,cosx)
- xlabel('x')
- ylabel('y')
- title(sin and cos Functions')
14Default Plot Given by Matlab
15We Want
- Titles and labels bigger
- Lines thicker
- Colors more contrasting
- Key data points visible
- Legend or labels close to lines
16How to Get What We Want
17Open the Property Editor
18Edit Figure Properties
19Edit Axes Properties
20Edit Line Properties
21So Far, A Better-Looking Figure
22Insert Legend
23Edit Legend Properties
24Insert Y Grid Line
25Final Version!
26Frequently 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.
27Other 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.
28A Whole Lot More
- 2D contour
- contour
- contourslice
- 3D plots
- plot3
- mesh
- surf
- Movie
- getframe
- movie
29Plotting in Excel
30Selecting Chart Type and Inputting Data
31Adding Labels and Selecting Location
32What do we need to change?
33Formatting your Chart
34Adding a Trendline
35Formatting the Data
36Editing the Line and Markers
37Formatting the Font
38Final Product!
39Other 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
40Lead through Excellence in Engineering
Communication
- 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.