BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
4 REPLIES 4
HPatel_SAS
SAS Employee
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.
deleted_user
Not applicable
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
ChrisNZ
Tourmaline | Level 20
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.
ChrisNZ
Tourmaline | Level 20
what procedure and device is this used with? More code needed imho.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2407 views
  • 0 likes
  • 3 in conversation