Data visualization with SAS programming

yaxis tick labels

Reply
N/A
Posts: 0

yaxis tick labels

I am having a hard time getting my tick mark labels to be 90 degrees, size 2.5pct, and appear exactly at the tick mark itself. Right now with the code below, SAS pushes the label to the middle of two tick marks, like there is an invisible buffer or spacer there. I don't want any space, I want the tick mark label (a number) to be exactly on the tick mark.

axis1 value=(a=90 h=3pct) order=(0 to 800 by 200) minor=none label=(a=90 color=black "Mean (ng/mL)") offset=(1);

I get this error along with the bizarre looking axis I describe:
"WARNING: The left vertical axis labeled MEAN could not be fit as specified. The axis values will overwrite."

Thanks,
Roki
SAS Employee
Posts: 6

Re: yaxis tick labels

I tried this and seem to work both at 9.13 and 9.2. There may be other options in your program that might be causing the problem, can you please provide an example.
N/A
Posts: 0

Re: yaxis tick labels

yes, this is my full code:

goptions reset=ALL
gunit=pct
colors=(black)
ftext=hwcgm001
ftitle=hwcgm009
htext=3
noborder
maxcolors=255
device=CGMOFML
hsize=10 in vsize=8 ;


axis1 value=(a=90 h=3pct) order=(0 to 800 by 200) minor=none label=(a=90 color=black "Mean, (ng/mL)") offset=(1);

axis2 order=(0 to 80 by 20) minor=none label=(color=black "Time (hr)") offset=(1);


proc gplot data=plotdata;
plot mean*time/
vaxis=axis1
haxis=axis2;
run;
quit;


In fact, when I don't do the 90 degree rotation of the tick mark labels, there is a distance from the tick mark label to the axis label. Some invisible buffer is being created i think.
Thanks
PROC Star
Posts: 1,672

Re: yaxis tick labels

Values (not "labels") are exactly centered on the tick marks with:

goptions reset=ALL
gunit=pct
colors=(black)
ftext=hwcgm001
ftitle=hwcgm009
htext=3
noborder
maxcolors=255
device=CGMOFML
hsize=10 in vsize=8 ;

axis1 value=(a=90 h=3pct) /*order=(0 to 800 by 200)*/ minor=none label=(a=90 color=black "Mean, (ng/mL)") offset=(1);

axis2 /*order=(0 to 80 by 20)*/ minor=none label=(color=black "Time (hr)") offset=(1);

proc gplot data=sashelp.air;
plot air*date / vaxis=axis1 haxis=axis2;
run;
quit;


If you add format air 8.0;, a shift can be seen. I reckon that may be the reason you see that "buffer": you request a long format, and sas provides it.
PROC Star
Posts: 1,672

Re: yaxis tick labels

what procedure and device is this used with? More code needed imho.
Ask a Question
Discussion stats
  • 4 replies
  • 786 views
  • 0 likes
  • 3 in conversation