Sample 25505: Specify logarithmic axes using PROC GPLOT
This example uses PROC GPLOT with the AXIS statement options LOGBASE and LOGSTYLE to produce a log scale axis.
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 example uses PROC GPLOT with the AXIS statement options LOGBASE and LOGSTYLE to produce a log scale axis.
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 border cback=white gunit=pct htitle=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
;
run;
/* Define the title */
title1 h=4 'Relationship of pH to H'
move=(-0,-2) h=2.8 '3'
move=(+0,+2) h=4 'O'
move=(+0,+2) h=2.8 '+'
move=(-0,-2) h=4 ' Concentration';
/* Define symbol characteristics */
symbol1 interpol=join color=black;
/* 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;
/* Define vertical axis characteristics */
axis2 logbase=10
logstyle=expand
color=black
label=(angle=90 h=4 color=black 'Concentration (Moles/Liter)' )
value=(tick=1 '10' height=2 '-14'
tick=2 '10' height=2 '-13'
tick=3 '10' height=2 '-12'
tick=4 '10' height=2 '-11'
tick=5 '10' height=2 '-10'
tick=6 '10' height=2 '-9'
tick=7 '10' height=2 '-8'
tick=8 '10' height=2 '-7'
tick=9 '10' height=2 '-6'
tick=10 '10' height=2 '-5'
tick=11 '10' height=2 '-4'
tick=12 '10' height=2 '-3'
tick=13 '10' height=2 '-2'
tick=14 '10' height=2 '-1')
major=(h=.8);
/* Generate plot and assign AXIS definitions */
proc gplot data= concentr;
plot conc*ph / haxis=axis1 vaxis=axis2;
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 example uses PROC GPLOT with the AXIS statement options LOGBASE and LOGSTYLE to produce a log scale axis.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Line
|
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 | z/OS | 9.1 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
Microsoft Windows XP Professional | 9.1 TS1M0 | |
64-bit Enabled AIX | 9.1 TS1M0 | |
64-bit Enabled HP-UX | 9.1 TS1M0 | |
64-bit Enabled Solaris | 9.1 TS1M0 | |
HP-UX IPF | 9.1 TS1M0 | |
Linux | 9.1 TS1M0 | |
OpenVMS Alpha | 9.1 TS1M0 | |
Tru64 UNIX | 9.1 TS1M0 | |