0% found this document useful (0 votes)
24 views24 pages

CENG 301.3 Graphics-042

This document discusses using MATLAB to design effective graphics. It provides guidelines for choosing the appropriate type of graphic based on the purpose and audience. It also outlines criteria for good graphic design, such as ensuring the purpose is clear and similar items are grouped. The document demonstrates how to customize a simple MATLAB plot comparing sine and cosine functions to make it suitable for a presentation. It lists frequently used MATLAB plotting functions and other types of 2D and 3D plots that can be generated.

Uploaded by

Hassan GDOURA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views24 pages

CENG 301.3 Graphics-042

This document discusses using MATLAB to design effective graphics. It provides guidelines for choosing the appropriate type of graphic based on the purpose and audience. It also outlines criteria for good graphic design, such as ensuring the purpose is clear and similar items are grouped. The document demonstrates how to customize a simple MATLAB plot comparing sine and cosine functions to make it suitable for a presentation. It lists frequently used MATLAB plotting functions and other types of 2D and 3D plots that can be generated.

Uploaded by

Hassan GDOURA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Designing Effective Graphics

Using MATLAB

The Cain Project in


Engineering and Professional Communication

Linda Driskill, driskila@ruf.rice.edu


Daniel Trahan, trahan@ruf.rice.edu
Gang Cheng, gang@rice.edu
The Purpose of Using Graphics
• In problem solving
 As part of design
 As analysis of operating data

• For persuasion and interpretation


 Dramatize relationships
 Promote identification
 Make complex information accessible

2
Criteria for Good Graphics
• Purpose clear?

• Pattern and arrangement lead eye without


distraction?

• Similar items grouped and indicated?

• Graphic hierarchy consistent?

• Fonts legible?
3
Criteria for Good Graphics (contd.)
• Critical components defined?

• Essential calculations behind claims shown?

• Any significant reference or standard


omitted?

• Presenters’ expertise demonstrated?

4
The Type of Graphics in Matlab
• Line graph
 2D
 3D

• Bar graph

• Pie graph

• Ribbon graph

5
Select the Right Type of Graphic
• Purpose
 Problem solving?
 Persuasion and interpretation?

• Audience
 What are their background?
 What are they interested to know?

• Context
 Presentation?
 Report/Paper? 6
Context
• Presentation
 Big titles, labels, etc.
 Can use any color
 Can use animation

• Report
 Smaller titles, labels, etc.
 Often just black and white
 Animation impossible

7
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 gridline sparingly.

8
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.

9
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']);

10
Default Plot Given by Matlab
sin and cos Functions
1

0.8

0.6

0.4

0.2

0
y

-0.2

-0.4

-0.6

-0.8

-1
0 1 2 3 4 5 6 7 8 9 10
x
11
We Want …
• Titles and labels bigger.

• Lines thicker.

• Colors more contrasting.

• Data points.

• Legend.
12
Open the Property Editor

13
Edit Figure Properties

14
Edit Axes Properties

15
Edit Line Properties

16
A Better-Looking Figure
sin and cos Functions
1

0.5

0
y

-0.5

-1
0 2 4 6 8 10
x 17
Insert Legend

18
Edit Legend Properties

19
Insert Y Grid Line

20
Final
sin and cos Functions
1.5
sin(x)
cos(x)
1

0.5

0
y

-0.5

-1

-1.5
0 2 4 6 8 10
x 21
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. 22
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.
23
A Whole Lot More …
• 2D contour
 “contour”
 “contourslice”

• 3D plots
 “plot3”
 “mesh”
 “surf”

• Movie
 “getframe”
 “movie”
24

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy