Data visualization with SAS programming

PROC SGPLOT creates too much blank space

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 18
Accepted Solution

PROC SGPLOT creates too much blank space

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;


Accepted Solutions
Solution
‎05-26-2015 10:55 AM
SAS Super FREQ
Posts: 1,141

Re: PROC SGPLOT creates too much blank space

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


All Replies
SAS Super FREQ
Posts: 925

Re: PROC SGPLOT creates too much blank space

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

Occasional Contributor
Posts: 18

Re: PROC SGPLOT creates too much blank space

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

Boxplot Example.png

Thank you!

Solution
‎05-26-2015 10:55 AM
SAS Super FREQ
Posts: 1,141

Re: PROC SGPLOT creates too much blank space

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

Occasional Contributor
Posts: 18

Re: PROC SGPLOT creates too much blank space

That worked! Thank you so much!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 712 views
  • 0 likes
  • 3 in conversation