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

The attached boxplot looks great, other than the fact that I have a ton of white space. I wamt wanting to make the width of the graph smaller or the width of the box plots themsevles larger. I have been trying to do this using bwidth option, but with no luck. I am needing to put this plot on a poster, but the grash produced is difficult to read. Thank you for any help you can give. Below is the SAS code used to create the box plot.

proc boxplot data=resident;

goptions ftext=CENTX;

symbol value = dot color=red;

plot percent*time/

cboxfill = ywh haxis = axis1 vaxis=axis2 ;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
MikeZdeb
Rhodochrosite | Level 12

hi ... you can also try using the HPOS goption ...

proc sort data=sashelp.class out=class;

by sex;

run;

goptions reset=all ftext='calibri/bo';

symbol value = dot color=red;

title 'default HPOS';

proc boxplot data=class;

plot height*sex/ cboxfill = ywh  ;

run;

goptions hpos=30;

title 'change HPOS to 30';

proc boxplot data=class;

plot height*sex/ cboxfill = ywh  ;

run;

more reading ...

HPOS is discussed is ... http://support.sas.com/rnd/datavisualization/papers/GraphBasics.pdf

and on ... http://www.sascommunity.org/wiki/Changing_the_Appearance_of_Vertical_Bar_Charts_using_the_HPOS_Optio...


hpos_default.pnghpos_30.png

View solution in original post

2 REPLIES 2
BuckyRansdell
SAS Employee

Hi HyunJee,

You can try something like this:

proc boxplot data=resident;

   plot percent * time / hoffset=25 boxwidth=10;

run;

HOFFSET=25 places the first tick mark 25% of the way across the graph.  BOXWIDTH=10 sets the width of each box to 10% of the graph width.  You can adust those values to your liking.

Bucky

MikeZdeb
Rhodochrosite | Level 12

hi ... you can also try using the HPOS goption ...

proc sort data=sashelp.class out=class;

by sex;

run;

goptions reset=all ftext='calibri/bo';

symbol value = dot color=red;

title 'default HPOS';

proc boxplot data=class;

plot height*sex/ cboxfill = ywh  ;

run;

goptions hpos=30;

title 'change HPOS to 30';

proc boxplot data=class;

plot height*sex/ cboxfill = ywh  ;

run;

more reading ...

HPOS is discussed is ... http://support.sas.com/rnd/datavisualization/papers/GraphBasics.pdf

and on ... http://www.sascommunity.org/wiki/Changing_the_Appearance_of_Vertical_Bar_Charts_using_the_HPOS_Optio...


hpos_default.pnghpos_30.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 2 replies
  • 973 views
  • 3 likes
  • 3 in conversation