Sample 25505: Specifying logarithmic axes using PROC GPLOT
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 1, Chapter 8.
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: GAXSPLA1 |
| TITLE: GAXSPLA1-Specifying Logarithmic Axes |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS AXIS SYMBOL GPLOT |
| PROCS: GPLOT |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(black blue green red) vpos=250
ftitle=swissb ftext=swiss htitle=5 htext=3;
/* Create the data set CONCENTR */
data concentr;
input ph conc;
datalines;
1 1E-1
2 1E-2
3 1E-3
4 1E-4
5 1E-5
6 1E-6
7 1E-7
8 1E-8
9 1E-9
10 1E-10
11 1E-11
12 1E-12
13 1E-13
14 1E-14
;
/* Define title and footnotes */
title1 'Relationship of pH to H'
move=(-0,-3) h=4 '3'
move=(+0,+3) h=5 'O'
move=(+0,+3) h=4 '+'
move=(-0,-3) h=5 ' Concentration';
footnote1 j=r 'GAXSPLA1 ';
/* Define symbol characteristics */
symbol interpol=join color=blue;
/* Define horizontal axis characteristics */
axis1 label=(h=4 'Scale of pH Values'
justify=left color=red h=4 'More acid'
justify=right color=blue 'More alkaline')
minor=none
length=60
width=3;
/* Define vertical axis characteristics */
axis2 logbase=10
logstyle=expand
color=red
label=(angle=90 h=4 color=black
'Concentration (Moles/Liter)' )
value=(tick=1 '10' height=1.5 '-14'
tick=2 '10' height=1.5 '-13'
tick=3 '10' height=1.5 '-12'
tick=4 '10' height=1.5 '-11'
tick=5 '10' height=1.5 '-10'
tick=6 '10' height=1.5 '-9'
tick=7 '10' height=1.5 '-8'
tick=8 '10' height=1.5 '-7'
tick=9 '10' height=1.5 '-6'
tick=10 '10' height=1.5 '-5'
tick=11 '10' height=1.5 '-4'
tick=12 '10' height=1.5 '-3'
tick=13 '10' height=1.5 '-2'
tick=14 '10' height=1.5 '-1')
major=(height=.75 cm)
minor=(color=blue height=.5 cm);
/* Generate plot and assign AXIS definitions */
proc gplot data= concentr;
plot conc*ph / haxis=axis1
vaxis=axis2;
run;
quit;

This example illustrates the AXIS statement options LOGBASE= and LOGSTYLE=. In addition, this example shows how the TICK= parameter of the VALUE= option modifies individual tick marks.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Axis
|
| Date Modified: | 2005-07-23 03:02:37 |
| Date Created: | 2005-05-23 14:11:56 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |