BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
greveam
Quartz | Level 8

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;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

4 REPLIES 4
ballardw
Super User

Size of what?

greveam
Quartz | Level 8

The numbers below the x-axis - from the boxplot.

greveam
Quartz | Level 8
Usually it would the numbers on the y-axis (response variable in boxplot) but I used the orient=horizontal to get the response variable mapped to the x-axis.
ballardw
Super User

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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 3897 views
  • 0 likes
  • 2 in conversation