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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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