BookmarkSubscribeRSS Feed
Lacona
Quartz | Level 8

Hey all, 

 

Under my boxplots is a line saying "name of the former variable" (= Name der früheren Variable) and the following actual names (DomBox WorldBox OpWeek) are not exactly under the boxplots and the color of the letters is not matching the color of the boxplots, instead there are odd little colored squares.

 

Bild 02.09.19 um 20.22.jpg

data box_gross;
set movie (drop=reldate prodbud);
run;

proc sort data=box_gross;
by title;
run;

proc transpose data=box_gross out=boxplot (rename=(col1=Gross _name_=Box));
var dombox opweek worldbox;
by title;
run;

proc sgplot data=boxplot;
vbox gross/group=box;
xaxis display=(nolabel);
yaxis values=(0 to 1.6E9 by 5E7) grid;
title HEUREKA;
run;

I couldn't find anything helpful in SAS help center or here in the posts.
Maybe someone could help me?

 

Thank you!

 

5 REPLIES 5
Lacona
Quartz | Level 8

Great! The "name of former variable" is vanished now.
But unfortunately, the names are not directly unter the boxplots and still have these colored squares.
How can I fix that?

 

 

ChrisNZ
Tourmaline | Level 20

If you want each box labelled in each group, maybe proc sgpanel is better then. See here.

Lacona
Quartz | Level 8

keylegend and category did it! Thank you!!!

proc sgplot data=boxplot;
vbox gross/group=box category=box dataskin=pressed;
xaxis display=(nolabel);
yaxis values=(0 to 1.6E9 by 5E7) grid;
keylegend/title="";
title HEUREKA;
run;

graph looks now like this:

 

Bild 02.09.19 um 22.42 (1).jpg

Almost perfect.

Is there an option to change the order of the xaxis values from alphabetic to something else? I would like to have OpWeek first, then DomBox, then Worldbox.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1374 views
  • 0 likes
  • 2 in conversation