sas >> SAS/Graph Axis Question

by Ken.Barz » Tue, 12 Aug 2008 07:31:57 GMT

Greetings all, (long time no SAS-L)


I was hoping someone could tell me if this is possible and if so, how.
The haxis for my gplot represents time from medication dosing. For
three different days I'll have specific minutes from dosing of -30, 15,
30, 90, 240, ...,1440. So I can overlay the three days using these and
Interpol=3Djoin, but I also have screening, admission and follow-up =
that I'm nominally setting at -120, -90 and 1500 and are plotted as just
a single symbol.


I would like to keep the numbers in their proper positions on the axis
(a la order=3D(-90 to 1500 by ...)) but I would like to have only the
ticks and labels for the specified times (order=3D(-90 -30 ...1440)) =
makes the ticks equidistant. Is there a way to have only the values I
want, but still have them be in their correct relative place?




sas >> SAS/Graph Axis Question

by msz03 » Tue, 12 Aug 2008 10:10:01 GMT

hi ... here's an example that uses annotate to add the tick marks and labels

I used SASHELP.CLASS, but used your axis order plus some ticks/labels at various positions

the label HEIGHT is moved down a bit, below the axis values using j=c

the footnote adds a bit of space below the plot

the titles also add some space

data ticks;
length text $4;
retain xsys '2' function 'label' style '"arial"';
input x @@;
y = 0; ysys = '1'; text = '|'; output;
y = -1; ysys = '9'; text = put(x,4. -c); output;
-90 -30 0 30 95 150 503 1200 1400

goptions reset=all ftext='arial' htext=1.5 gunit=pct;

symbol1 v=dot c=blue;

axis1 offset=(2,2)
order=-90 to 1500 by 1
major=none minor=none value=none
label=(j=c ' ' j=c 'Height');

title ls=2;
title2 a=90 ls=2;
title3 a=-90 ls=2;
footnote ls=2;

proc gplot data=sashelp.class;
plot weight*height / noframe haxis=axis1 annotate=ticks;

sas >> SAS/Graph Axis Question

by donaldjhenderson » Tue, 12 Aug 2008 10:11:41 GMT


I am not a graph expert by any stretch of the imagination, but I wonder if
you could use formats for this.

It looks like your axis statement would need to by -90 to 1500 by 15. If you
then created a format like:

Proc format;
picture subset
-75 = ' '
-60 = ' '
-45 = ' '
-30 = '-30'
-15 = ' '
. . . . . .
other = '0009'

And then used that in your proc format it might come close? You will still
have tick marks at every interval of 15, but the ones you want to suppress
won't have a value.

If not, perhaps one of the Graph gurus can comment on whether annotate could
do this.


Similar Threads

1. Axis for SAS Graph

2. Axis Statement in SAS/Graph


How do I print my vertical axis label as


With wat I tried I'm getting HEIGHT vertically but at 90 angle( using
angle=90 option in Axis statement)

Any help will be highly appreciated!


3. is there length limitation for value on the AXIS, SAS/Graph

4. SAS Graph - Odd Axis Labels problems

     I am using a PROC GPLOT to generate a bar-line chart in a report.
The x-axis comprises SAS dates - data points for 13 months. I want the
months to appear in the label on a quarterly basis, and am specifying
the appropriate interval in the AXIS statement. Strangely, the code
prints the quarterly axes labels correctly for one month while in the
next month it prints it at every half year.
     I did a diff on the two versions of the code for each month, and
both of them are the same. Is anybody aware of any reason why this may
happen? Thanks in advance.


Code -

(In the first instance which works, t12m_start gets resolved to MAR07
and reporting month to MAR08 while in the second case it gets resolved
to APR07 and APR08 respectively)

axis1 label=none offset=(0,2) order=(0 to 0.2 by .04)
      major=(h=-1) minor=none value=(h=4);
axis2 label=none offset=(0,2) order=(0 to 0.16 by .04) major=none
minor=none value=none
axis3 label=none offset=(5,5) order=("&t12m_start"d to
"&reporting_month"d by quarter)
      value=(color=black height=5 angle=55 rotate=0)
          major=(width=3) minor=none length=80pct;

symbol1 interpol=needle value=none width=20 color=&firstbarclr;
symbol2 interpol=spline value=none width=2 height=1 ;
symbol3 interpol=spline value=none width=2 height=1 ;
symbol4 interpol=spline value=none width=2 height=1 ;

legend1 label=none shape=symbol(4,2) value=(h=4 'Loss' 'Costs' 'Revenue')
        /*position=(bottom center outside)*/ origin=(30pct,);

5. SAS/Graph Axis & Label

6. SAS GRAPHS - 2 horizontal axis

I'd like to draw 2 graphs that overlay , an I want each to have his
own scale ( that means I'll have the first graph (NOX) in red - in one
scale- its axis will be on the left , and the other one (O3)- in black
in a different scale its axis will be on the right.I'd like to have
something like :
axis3 order = (0 to 100 by 5)- that will be horizontal as well.

my syntax so for was :

title "Daily Mean  of O3 [ppb] Vs NOX [ppb] &name. station (&stat.)";
/*O3*/symbol1 i=j v=dot c=black h=0.08 cm w=0.5;
/*NOX*/symbol2 i=j v=dot c=red   h=0.08 cm w=0.5;
axis1 order=('1Jan2000'd to '1Jan2005'd by year)
      label=(f=swiss h=0.5 cm  'date') minor=none;
axis2 order = (0 to 350 by 10);

proc gplot data=data.memuza_yomi;
plot O3_mean*date NOX_mean*date  /overlay vaxis = axis2 haxis=axis1
where stat_id=&stat.;
run; quit;

Thanks in advance,

7. Graph: Axis position

8. moving axis to middle of graph

Greetings -

I'm using gplot to generate a graph where the vertical axis will go from
-50 to 50.  I've been trying to figure out a way to plot the horizonatal
axis in the middle of the graph, i.e., at zero.

It would be simple to use the annotate macros to draw the axis at zero,
but then I can't figure out how to suppress the axis at -50.

Would anyone have a suggestion how to move the bottom axis with a minimum
number of keystrokes?

Many thanks in advance - Deb