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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 979 views
  • 3 likes
  • 3 in conversation