BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
A_Kh
Barite | Level 11

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;

 cars.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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;

Ksharp_0-1752025700591.png

 

View solution in original post

7 REPLIES 7
FreelanceReinh
Jade | Level 19

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;
A_Kh
Barite | Level 11

Hi @FreelanceReinh , 

Thank you for explanation. Could we have the column label underneath the column, not separated by space? 
cars.PNG

FreelanceReinh
Jade | Level 19

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.

Ksharp
Super User

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;

Ksharp_0-1752025700591.png

 

A_Kh
Barite | Level 11

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. 

Ksharp
Super User

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;
Tom
Super User Tom
Super User

And you can add NOTICKS to COLAXIS to get rid of the little tick marks.

colaxis display=(nolabel noticks);

Tom_0-1752342659202.png

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 7 replies
  • 1053 views
  • 8 likes
  • 4 in conversation