Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave

Similar presentations


Presentation on theme: "Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave"— Presentation transcript:

1 Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave kate@atmos.colostate.edu

2 Syllabus Week 13: T 4/21 –Intro to MATLAB –MATLAB GUI –Variables –Operations Week 14: T 4/28 –Functions and scripts –Programming style –Comments –Flow control –File I/O Week 15: T 5/5 –Graphics –Plot types –Figure window –Figure properties –Figures: special topics Week 16: T 5/12 –MATLAB toolboxes –Statistics –Signal processing –Special topics

3 Plot Types – Basic Line Plots

4 Plot Types – Specialized Plots

5 Plot Types – Contour Plots

6 The Figure Window Basic controls Editing properties Saving figures

7 Objects and Handles To automate figure generation and editing, you must think of the figure in terms of objects and handles

8 Figure Properties Line details, colors, axes, labels, colorbar, legend, special characters

9 Plot Types – Typical 3D Plot Here’s a series of typical steps in creating a 3D plot, you can alter as necessary for machine-specific needs. These steps display some of the many figure properties that can be modified as needed.

10 Multiple Plots per Figure The subplot command –Usage: subplot(m,n,i) is used to reference the i th plot in an m x n matrix of plots –Example:

11 Multiple Plots per Figure The subplot command –Special usage: plots taking up more than one spot –Example:

12 Multiple Variables per Plot The plotyy command –Usage: plotyy(x1, y1, x2, y2, plot type) –Example: AIRC_lifetime_plot.m

13 Saving Figures and Images The print and saveas commands –These commands can save figures to.fig files (the saveas command) or to various image files (the print command, can also be used to output to a specified printer) –Ex. print('-dtiffn',temp_outtiff); saveas(gcf, temp_outfig); In the example, variables are holding the strings to be used as file names. See make_ind_plot.m for more information.

14 Automating Figure Production The close command –While each Figure window has its own unique handle, coding scripts to automatically generate figures can be simplified by closing each figure as you finish it –Ex. close Figure 1

15 Questions?


Download ppt "Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave"

Similar presentations


Ads by Google