{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Plotting+posted

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

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

Nomenclature for a typical xy plot 5-2 5-2

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

View Full Document
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
The autoscaling feature in MATLAB selects tick-mark spacing. 5-4 5-4

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

View Full Document
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
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

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

View Full Document
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
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)

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

View Full Document
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
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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}