Sample 25575: Adding a right vertical axis to a plot using PROC GPLOT
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 2, Chapter 21. For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GPLAXIS1 |
| TITLE: GPLAXIS1-Adding a Right Vertical Axis to a Plot |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GOPTIONS GPLOT AXIS |
| PROCS: GPLOT |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
| MISC: THIS IS A BUBBLE PLOT. |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(black blue green red)
ftext=swiss ftitle=swissb htitle=6 htext=3;
/* Create the data set JOBS */
data jobs;
length eng $5;
input eng dollars num;
datalines;
Civil 27308 73273
Aero 29844 70192
Elec 22920 89382
Mech 32816 19601
Chem 28116 25541
Petro 18444 34833
;
/* Create the data set JOBS2 */
/* Calculate variable YEN */
data jobs2;
set jobs;
yen=dollars*125;
run;
/* Define titles and footnote */
title1 'Member Profile';
title2 h=4 'Salaries and Number of Member Engineers';
footnote j=r 'GPLAXIS1 ';
/* Define horizontal-axis characteristics */
axis1 offset=(5,5)
label=none
width=3
value=(h=4);
/* Generate bubble plot with second vertical axis */
proc gplot data= jobs2;
format dollars dollar7. num yen comma9.0;
bubble dollars*eng=num / haxis=axis1
vaxis=10000 to 40000 by 10000
hminor=0
vminor=1
blabel
bfont=swissi
bcolor=red
bsize=12
caxis=blue;
bubble2 yen*eng=num / vaxis=1250000 to 5000000 by 1250000
vminor=1
bcolor=red
bsize=12
caxis=blue;
run;
quit;

This example illustrates how a BUBBLE2 statement generates a right vertical axis that displays the values of the vertical coordinates in a different scale from the scale that is used for the left vertical axis.
| Type: | Sample |
| Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Bubble Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Axis SAS Reference ==> Procedures ==> GPLOT
|
| Date Modified: | 2005-08-27 03:03:26 |
| Date Created: | 2005-05-23 14:16:33 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |