![]() Chapter Contents |
![]() Previous |
![]() Next |
| The GPLOT Procedure |
| Requirements: | You cannot use the PLOT2 statement alone. It can be used only with a PLOT or BUBBLE statement. At least one plot request is required. |
| Global statements: | AXIS, FOOTNOTE, LEGEND, PATTERN, SYMBOL, TITLE |
You can use statement options to manipulate the axes and modify the appearance of your graph. You can use SYMBOL definitions to modify plot symbols for the data points, join data points, draw regression lines, plot confidence limits, or specify other types of interpolation. For more information on the SYMBOL statement, see About SYMBOL Definitions.
| PLOT2 plot-request(s) </option(s)>; |
option(s) can be one or more options from any or all of the following categories:
| Required Arguments |
For more information about plot requests, see PLOT Statement.
| Options |
| AUTOHREF | |
| CHREF= | |
| DESCRIPTION= | |
| HAXIS= | |
| HMINOR= | |
| HREF= | |
| HTML= | |
| HTML_LEGEND= | |
| HZERO= | |
| LHREF= | |
| NAME= |
See PLOT Statement for complete descriptions of options that you can use with the PLOT2 statement.
| Matching Plot Requests |
The plot requests in both the PLOT and PLOT2 statements must be evenly matched as in this example:
plot y*x b*a;
plot2 y2*x b2*a;
Plot requests of the form (y-variable(s))*(x-variable(s)) in both the PLOT and PLOT2 statements generate multiple graphs. These statements produce graphs like the ones diagrammed in Diagram of Graphs Produced by Multiple Plot Requests in PLOT and PLOT2 Statements (the actual plots are produced on separate pages):
plot (y b)*(x a);
plot2 (y2 b2)*(x a);
Diagram of Graphs Produced by Multiple Plot Requests in PLOT and PLOT2 Statements
When both the PLOT and PLOT2 statements use plot requests of the form y-variable*x-variable=third-variable, each statement generates a separate legend. If the third variable has two values, these statements produce one graph with four sets of data points, as shown in Diagram of Multiple Plots on One Graph (the figure assumes SYMBOL statements are used to specify the plot symbols that are shown and to connect the data points with straight lines):
plot y*x=z;
plot2 y2*x=z;
Diagram of Multiple Plots on One Graph
| Using a Second Vertical Axis |
For example, if Y is height in inches and Y2 is height in centimeters and if the Y axis values range from 0 to 84 inches and the Y2 axis values range from 0 to 213.36 centimeters, the plot will be like the diagram shown in Right Axis with Different Scale of Values.
Right Axis with Different Scale of Values
If your data contain variables with different data values (such as height and weight), you can display one type of data on the left axis and another type of data on the right axis. Because the Y variable and the Y2 variable contain different data, two sets of data points are displayed on the graph. For example, if Y is height and Y2 is weight, the plot will be like the diagram in Right Axis with Different Values and Different Scale.
Right Axis with Different Values and Different Scale
If your data contain two sets of values for the same type of data, you can use the PLOT2 statement to generate a right axis that is calibrated the same as the left axis so that the data points on the right of the graph are easier to read. For example, if Y is high temperatures and Y2 is low temperatures, you can create a graph like the diagram in Right Axis with Same Scale of Values.
Right Axis with Same Scale of Values
| Using PATTERN and SYMBOL Definitions |
For more information, see About SYMBOL Definitions.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.