- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have a issue with sgplot. I have categorical y-axis with text values and numerical x axis. I would want to control the x-axis font size separately from the y-axis, since the x-axis font size is just fine, but my y axis values are so long that I would need to reduce the font size. So far I have found proc template the only way to even change the font sizes. However when I change the 'GraphvalueFont' value it affects both the x and y axis. The problem is that now the x-axis becomes unreadable. So is there any way to control those font sizes separately? Could I somehow initialize a new class for example GraphValueText2 or something? Or is the GTL and sgrender the way to go?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Have you tried the LABELATTRS= and VALUEATTRS= option of the YAXIS statement?
See sample below:
do y = "A", "B", "C", "D";
length y2 $ 64;
call missing(y2);
do i = 1 to 10;
y2 = catx(" ", y2, repeat( y, ceil(ranuni(0) * 8 )));
end;
x = ceil( ranuni(0) * 50);
output;
end;
run;
proc sgplot data=have;
hbar y2 / response=x;
yaxis
labelattrs=( size=5pt color=red )
valueattrs=( size=5pt color=red )
/* fitpolicy=splitalways */
;
xaxis
labelattrs=( size=12pt )
valueattrs=( size=12pt )
;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Have you tried the LABELATTRS= and VALUEATTRS= option of the YAXIS statement?
See sample below:
do y = "A", "B", "C", "D";
length y2 $ 64;
call missing(y2);
do i = 1 to 10;
y2 = catx(" ", y2, repeat( y, ceil(ranuni(0) * 8 )));
end;
x = ceil( ranuni(0) * 50);
output;
end;
run;
proc sgplot data=have;
hbar y2 / response=x;
yaxis
labelattrs=( size=5pt color=red )
valueattrs=( size=5pt color=red )
/* fitpolicy=splitalways */
;
xaxis
labelattrs=( size=12pt )
valueattrs=( size=12pt )
;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Well this is embarrasing, but thanks a lot. I have never encountered with these options in the sas help, but now that I googled it I found them.