Hi,
How can I control x-axis size in proc template (=valueattrs in proc sgplot)? Currently everything is size 10 aside from the xaxis, which is size 7. Thanks!
proc template;
define statgraph one;
begingraph;
layout lattice / columns=1 rowdatarange=union columngutter=10px;
rowaxes;
rowaxis / display=(tickvalues) tickvalueattrs=(size=10);
endrowaxes;
layout overlay / walldisplay=none xaxisopts=(tickvalueattrs=(size=10) labelattrs=(size=10))
xaxisopts=(linearopts=(viewmin=0 viewmax=10)
griddisplay=on display=(line ticks tickvalues));
innermargin / align=left;
axistable y=ObsId=value / showmissing=false valuehalign=center
headerlabel='Event/Value' HEADERLABELATTRS=(size=10)
valueattrs=(size=10) labelattrs=(size=10) pad=(right=5pct);
endinnermargin;
boxplot y=marker x=Obs / orient=horizontal display=(caps fill mean median) name='a';
discretelegend "a" / DISPLAYCLIPPED=true title="marker" location=outside valign=top
halign=center border=false across=1 valueattrs=(color=white size=10) titleattrs=(size=10);
endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=combined template=one;
run;
Look closely at this bit of your code:
layout overlay / walldisplay=none xaxisopts=(tickvalueattrs=(size=10) labelattrs=(size=10)) xaxisopts=(linearopts=(viewmin=0 viewmax=10)
You have TWO xaxisopts. SAS will use the "latest" or last option set when you provide multiples.
Make all of the options fit into one xaxisopts and I suspect you will have your solution.
Size of what?
The numbers below the x-axis - from the boxplot.
Look closely at this bit of your code:
layout overlay / walldisplay=none xaxisopts=(tickvalueattrs=(size=10) labelattrs=(size=10)) xaxisopts=(linearopts=(viewmin=0 viewmax=10)
You have TWO xaxisopts. SAS will use the "latest" or last option set when you provide multiples.
Make all of the options fit into one xaxisopts and I suspect you will have your solution.
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.
Ready to level-up your skills? Choose your own adventure.