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

I'm trying to create box plots with PROC SGPLOT, but I end up with way too much blank gray space at the bottom of the graphs (where the legend usually goes). Does anyone know how to fix this so that the "empty" space doesn't take up so much room and the graph itself can be larger? This is my code:

%MACRO boxplots (compound=);

DATA final2;

SET final;

label concentration="uM";

RUN;

proc sgplot data=final2 dattrmap=attrmap noautolegend;

title "&compound.";

vbox concentration / category=group group=group attrid=group;

where compound="&compound.";

xaxis label=" ";

run;

title " ";

%MEND boxplots;

data attrmap;

   input id $ value $7. @15 fillcolor $10. linecolor $8.;

   datalines;

group  RT       white      black

group  BR    LTGRAY     black

;

run;

proc template;

  define style myfont;

  parent=styles.default;

   style GraphFonts /

         'GraphDataFont' = ("Arial",28pt,bold)

         'GraphUnicodeFont' = ("Arial",28pt,bold)

         'GraphValueFont' = ("Arial",28pt,bold)

         'GraphLabelFont' = ("Arial",28pt,bold)

         'GraphFootnoteFont' = ("Arial",28pt,bold)

         'GraphTitleFont' = ("Arial",28pt,bold)

         'GraphAnnoFont' = ("Arial",28pt,bold);

end;

run;

ods graphics on;

ods rtf file="XXXXXXXXXXXXXXXXXXXX" style=myfont;

%boxplots (compound=2-Oxoisocaproate);

%boxplots (compound=3-Hydroxybutyrate);

%boxplots (compound=3-Hydroxyisovalerate);

ods rtf close;

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

You have x axis label=' '.  This leaves a blank space for the label.  To remove the xaxis label use XAXIS DISPLAY=(NOLABEL);.

View solution in original post

4 REPLIES 4
DanH_sas
SAS Super FREQ

Two questions:

1. What version of SAS are you running?

2. Since we do not have the data, can you attach a picture that demonstrates the issue?

Thanks!

Dan

acuffza
Calcite | Level 5

Sure! I'm running SAS 9.4. Here's one of the graphs:

Boxplot Example.png

Thank you!

Jay54
Meteorite | Level 14

You have x axis label=' '.  This leaves a blank space for the label.  To remove the xaxis label use XAXIS DISPLAY=(NOLABEL);.

acuffza
Calcite | Level 5

That worked! Thank you so much!

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
  • 4 replies
  • 3013 views
  • 0 likes
  • 3 in conversation