{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Plotting+posted

Plotting+posted - Nomenclature for a typical xy plot 5-2 An...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Nomenclature for a typical xy plot 5-2 5-2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
An Example: The following MATLAB session plots y = 0 . 4 1 . 8 x for 0 x 52, where y represents the height of a rocket after launch, in miles, and x is the horizontal (downrange) distance in miles. >>x = 0:0.1:52; >>y = 0.4*sqrt(1.8*x); >>plot(x,y) >>xlabel(’Distance (miles)’) >>ylabel(’Height (miles)’) >>title(’Rocket Height as a Function of Downrange Distance’) 5-3 5-3
Background image of page 2
The autoscaling feature in MATLAB selects tick-mark spacing. 5-4 5-4
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The plot will appear in the Figure window. You can obtain a hard copy of the plot in several ways: 1. Use the menu system. Select Print on the File menu in the Figure window. Answer OK when you are prompted to continue the printing process. 2. Type print at the command line. This command sends the current plot directly to the printer. 3. Save the plot to a file to be printed later or imported into another application such as a word processor. You need to know something about graphics file formats to use this file properly. See the subsection Exporting Figures (page 225). 5-5 5-5
Background image of page 4
When you have finished with the plot, close the figure window by selecting Close from the File menu in the figure window. Note that using the Alt-Tab key combination in Windows-based systems will return you to the Command window without closing the figure window. If you do not close the window, it will not reappear when a new plot command is executed. However, the figure will still be updated. 5-6 5-6
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Guidelines for a Good Plot The following list describes the essential features of any plot: 1.Each axis must be labeled with the name of the quantity being plotted and its units! 1.Each axis should have regularly spaced tick marks at convenient intervals—not too sparse, but not too dense 1. If you are plotting more than one curve or data set, label each on its plot or use a legend to distinguish them. 5-7 5-7
Background image of page 6
4. If you are preparing multiple plots of a similar type or if the axes’ labels cannot convey enough information, use a title. 1.If you are plotting measured data, plot each data point with a symbol such as a circle, square, or cross. 2.Sometimes data symbols are connected by lines to help the viewer visualize the data, especially if there are few data points. However, connecting the data points, especially with a solid line, might be interpreted to imply knowledge of what occurs between the data points. Thus you should be careful to prevent such misinterpretation. 5-8 5-8 Guideline for a Good Plot (continued)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7. If you are plotting points generated by evaluating a function (as opposed to measured data), do not use a symbol to plot the points. Instead, be sure to generate many points, and connect the points with solid lines. 5-9 5-9 Guidelines for a Good Plot
Background image of page 8
The grid and axis Commands The grid command displays gridlines at the tick marks corresponding to the tick labels. Type grid on to add gridlines; type grid off to stop plotting gridlines. When used by itself, grid toggles this feature on or off, but you might want to use grid on and grid off to be sure.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}