• Customizing Plot
- SYMBOL - statement controls appearance of plot.
- Options:
Height = Controls the size of the point of
plot symbol.
Value = Names the plot point character. These also
include any printable character such as “H”.
(Attached are a list of some of the special symbols)
Color = Defines the symbol color
CO = Defines the color for CI lines and area outlines
CV = Defines color for plot symbols
CI = Defines color for plot lines
Multiple symbol statements are used when more than one plot is
being displayed in a set of axes.
proc import
dbms=CSV
datafile="G:\stat598\count.csv"
out=combined1 replace;
getnames=yes;
run;
Line plot
proc import
dbms=EXCEL2000
datafile="G:\stat598\srs.xls"
out=ABC replace;
getnames=yes;
run;
proc import
dbms=CSV
datafile="G:\stat598\airpollution.csv"
out=pollution replace;
getnames=yes;
run;
data pollution;
set pollution;
sample=_N_;
run;
Note:- The axis are default here (can you point what is not quite correct here). We will see more on axis control
latter. If you don’t specify symbols, defaults symbols will be used. If you want you can easily add a title and
footnote.
If you do not use overlay option you will get multiple plots.
Axis Control
If it does not bother you to write many lines of code, SAS gives you enough liberty to do what ever you want with
your plot.
AXIS Statement defines setting controls for axis color, the color and size
of tick marks, the order and value of the major tick marks and the text
attributes of the axis label and major tick marks.
AXIS Statements are global.
AXIS statements are independent of the input data.
Use PLOT Statement options such as VMINOR=, XTICKNUM=, and
NOAXES to control plot axes from within GPLOT.
• AXIS Statement –Options
1. Label= (Height = (Size of Print)
Color = (Color of Print)
Font = (Font of Print)
“Label”)
2. Order = (Define a series of major tick:
example: (0 to 5 by 10))
3. Minor = (this options turns off minor tick marks)
NOTE: SAS has many ways of programming to accomplish the same graph. I will show you very basic stuff to
get started.
It will be too complicated too show the code for the above here, but nevertheless the
point is that it is possible to get above plot by SAS.
Often it is require that you will save your figure as an external file. For example LaTEx
requires you to save it as PS (postscript file). Here is the trick (but only one figure at a
time)
GOPTIONS RESET=ALL;
GOPTIONS RESET=ALL;
Proc Gchart
To draw pie chart, bar chart and many more standard plotting this is
useful
A Fancy 3d plot
title1 color=green font=triplex 'Fancy hat plot';
data hat;
do x=-5 to 5 by 0.25;
do y=-5 to 5 by 0.25;
z=sin(sqrt(x*x+y*y));
output;
end;
end;
run;
data rough ;
set hat ;
if ranuni(1)<.5 then
output ;
run ;
proc g3d data=rough ;
plot y*x=z ;
run;
You can view, modify or create device drivers. Can use the interactive procedure as follows:
Proc Gdevice ;
Run ;
Proc goptions ;
Run ;
I will stop here but tutorial on SAS graphics can go on and on.