Sample 24938: Display unevenly spaced horizontal axis tick marks
This sample program uses PROC GPLOT with the Annotate facilty to create a horizontal axis that has unevenly spaced tick marks.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample program uses PROC GPLOT with the Annotate facilty to create a horizontal axis that has unevenly spaced tick marks.
The graphics output in the Results tab was produced using SASĀ® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create the sample data set */
data a;
input Xvar Yvar;
datalines;
-9 90
-6 60
-3 30
0 0
1 10
2 20
3 30
4 40
6 60
8 80
12 120
;
run;
/* Create the annotate data set which will then */
/* be used to produce the horizontal tick marks */
/* and horizontal axis values with PROC GPLOT. */
data anno;
length function $8;
retain xsys '2' ysys '3' color 'black' when 'a';
set a;
function='move';
x=xvar; y=20;
output;
function='draw';
x=xvar; y=17.5;
output;
function='label';
x=xvar; y=15;
text=left(put(xvar,3.));
output;
run;
symbol1 interpol=join color=vibg;
/* Use the following AXIS statement to "white out" */
/* the default horizontal axis values and tick marks */
axis1 value=(c=white) major=(c=white) minor=none
order=(-9 to 12 by 1) origin=(,20)pct;
axis2 minor=none;
title1 'Generate Uneven Axis Tick Marks';
/* Create the graph by using the ANNO= option */
/* on the PLOT statement of GPLOT. */
proc gplot data=a;
plot yvar*xvar / haxis=axis1 vaxis=axis2 anno=anno;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample program uses PROC GPLOT with the Annotate facilty to create a horizontal axis that has unevenly spaced tick marks.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation
|
Date Modified: | 2005-08-31 03:03:22 |
Date Created: | 2004-11-11 11:08:03 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | n/a |