Hello Community,
Could anyone fix the below code to display panel labels in the bottom of each panel (which is on top of panel right now)? I expected colheaderpos=bottom
option to resolve the issue, but apparently I'm not using the right option.
Thank you!
proc sgpanel data=sashelp.cars noautolegend description="";
where type eq 'Sedan';
panelby origin/novarname columns=3 rows=1 colheaderpos=bottom;
vbox invoice;
rowaxis integer label="Price";
run;
You want this ?
proc sgpanel data=sashelp.cars noautolegend description="";
where type eq 'Sedan';
panelby origin/novarname columns=3 rows=1 noheader proportional uniscale=row;
vbox invoice/category=origin;
rowaxis integer label="Price";
run;
Hello @A_Kh,
The documentation of the PANELBY statement says that the COLHEADERPOS= option "has no effect if the panel uses the PANEL layout" (which is the default of the LAYOUT= option). So use a different layout: COLUMNLATTICE looks very similar to you current layout.
panelby origin/novarname columns=3 rows=1 colheaderpos=bottom layout=columnlattice;
Hi @FreelanceReinh ,
Thank you for explanation. Could we have the column label underneath the column, not separated by space?
There doesn't seem to be an option of the PANELBY statement to control that space. In this case you could specify the NOHEADER option and create your own header using SG annotation. Not sure if this would be worth the effort, though.
You want this ?
proc sgpanel data=sashelp.cars noautolegend description="";
where type eq 'Sedan';
panelby origin/novarname columns=3 rows=1 noheader proportional uniscale=row;
vbox invoice/category=origin;
rowaxis integer label="Price";
run;
Thank you, @Ksharp , this works for me. Would it be possible to hide the variable name "Origin" in the bottom?
I could label it and use the label instead of variable name, but hiding it completely would be perfect.
Here you go.
proc sgpanel data=sashelp.cars noautolegend description=""; where type eq 'Sedan'; panelby origin/novarname columns=3 rows=1 noheader proportional uniscale=row; vbox invoice/category=origin; rowaxis integer label="Price"; colaxis display=(nolabel); run;
And you can add NOTICKS to COLAXIS to get rid of the little tick marks.
colaxis display=(nolabel noticks);
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.