Date: Sun, 16 Aug 2009 10:35:25 -0400 Joe Whitehurst "SAS(r) Discussion" Joe Whitehurst Re: sas gplot. aliitle basic question To: tal <33af868b-83ee-4696-9814-d01de1e80f0a@t13g2000yqt.googlegroups.com> text/plain; charset=ISO-8859-1

Here's an example program that you may find helpful for gaining an understanding of how to generate plots using PROC GLOT. This is a medium complexity example. You can generate a simple default plot with just this amount of code; Proc gplot date=mydata.sas_data_set; plot x*y; run;

Where x an y are variables on mydata.sas_data_set.

********************************************************************************************************************* Medium complexity Example **********************************************************************************************************************

%let begdate=%str('01sep99'd); %let enddate=%str('30sep99'd);

data trafsum2; set sub3.monthly; pgsviewd=pageview/100000; visitors=visitors/10000; run;

FILENAME trafsumm FTP '/sasweb/images/MTD_Traffic_Summary.gif' host='10.102.8.248' user='sascont1' pass='sas4auto99' recfm=s ;

goptions reset=all gaccess=gsasfile gsfmode=replace prompt dev=gif733 gsfname=trafsumm vpos=0 hpos=0 htext=1 ftext=swissb rotate=landscape border hby=1 fby=swissb cby=black ctext=black;; *goptions reset=all dev=win; *goptions reset=all rotate=landscape border dev=win targetdevice=gif733; title1 c=black f=swissb h=2 j=c ' '; title2 c=black f=swissb h=2 j=c 'TRAFFIC SUMMARY'; %annomac; data weekends; %system(2,1); %dclanno; text='WKND'; do day=&begdate to &enddate by 1; weekday=weekday(day); if weekday=7 then do; when='B'; %system(2,1); %bar(day,0,day+1,100,pay,0,s); text='WKND'; %label(day+.5,100,text,black,0,0,1,swissb,b); end; if weekday=1 then wkday='S'; else if weekday=2 then wkday='M'; else if weekday=3 then wkday='T'; else if weekday=4 then wkday='W'; else if weekday=5 then wkday='T'; else if weekday=6 then wkday='F'; else if weekday=7 then wkday='S'; %system(2,1); %label(day,97,wkday,black,0,0,1,swissb,b); end; run; symbol1 interpol=join line=1 value=dot h=.5 width=2 color=blue; symbol2 interpol=join line=1 value=dot h=.5 width=2 color=red; symbol3 interpol=join line=1 value=dot h=.1 width=1 color=red; symbol4 interpol=join line=1 value=dot h=.1 width=1 color=pink; symbol5 interpol=join line=1 value=dot h=.1 width=1 color=cyan; symbol6 interpol=join line=1 value=dot h=.1 width=1 color=white;

symbol7 interpol=join line=1 value=dot h=.1 width=1 color=red; symbol8 interpol=join line=1 value=dot h=.1 width=1 color=red; symbol9 interpol=join line=1 value=dot h=.1 width=1 color=blue; symbol10 interpol=join line=1 value=dot h=.1 width=1 color=pink; symbol11 interpol=join line=1 value=dot h=.1 width=1 color=cyan; symbol12 interpol=join line=1 value=dot h=.1 width=1 color=white;

axis1 order=(0 to 10 by .5) minor=(number=5) label=(rotate=0 angle=0 j=r h=1.25 f=swissb c=blue 'Daily' j=r 'Pages' j=r 'Viewed' j=r "(100k's)") value=(color=blue f=swissb) length=70pct offset=(0,2) width=3; axis2 order=('01sep99'd to '30sep99'd by day) minor=none /*(number=0) */ label=(color=black f=swissb h=1.25 'September 1999') value=(color=black f=swissb h=.8) length=80pct offset=(0,0) width=3; axis3 order=(0 to 14 by 1) minor=(number=3) label=(rotate=0 angle=0 j=l h=1.25 f=swissb c=red 'Daily ' j=l 'Visitors' j=l "(10K's)") value=(color=red f=swissb) length=70pct offset=(0,2) width=3; proc gplot data=trafsum2 anno=weekends; format date day2. pgsviewd mtdpages cvisitor 3.2; plot pgsviewd*date / vaxis=axis1 haxis=axis2 /*cframe=yellow*/; plot2 visitors*date /

vaxis=axis3 haxis=axis2; run; quit;

To control titles, plot axes, legends, etc., you use TITLE, AXIS, PATTERN, SYMBOL and LEGEND statements;

On Sun, Aug 16, 2009 at 9:23 AM, tal <talila.ar@gmail.com> wrote:

> Hi, > I'd like to do like a bar plot, but thinner (sorry for the stupid > question). > > My problem is that i don't know the term in english to look for this > types of plots in google. > > I'd like to draw something like what I draw below, only with vertical > lines in-between the stars ( the stars are not necessary- it's just > for explaining visually what I need) > > Thanks in advance > > > > * > * > * > * * > * * * > * * * > * * * > ____________________________________ >

Back to: Top of message | Previous page | Main SAS-L page