Data visualization with SAS programming

A strange warning message about sgplot hbar

Reply
Contributor
Posts: 70

A strange warning message about sgplot hbar

My code is very simple:

goptions reset=all;
proc sgplot data=MeanValue;
xaxis label="Mean Score" values=(0 to 5 by 1);
yaxis label=" Test Items" ;
hbar Item / response=Avg barwidth=0.4;
run;

But I got this warning message:

WARNING: A very large output size of (3840, 2880) is in effect. This could make Java VM run out of memory and result in some Java exceptions. You should reduce the output size or DPI settings.

How to resolve it?

My another question is: how to split the long yaxis string tick-mark value into multiple lines?

Your help will be highly appreciated.
SAS Super FREQ
Posts: 890

Re: A strange warning message about sgplot hbar

Hey,

First of all, goptions reset=all has no effect here. To reset the ODS GRAPHICS environment, use this:

[pre]
ods graphics / reset;
[/pre]

See if that cleans up your size issue. As for the long y-axis tick value, there is currently not a way to split it. If it is possible to abbreviate it, you could use a user-defined format for that one value to shorten it.

Hope this helps,
Dan
SAS Super FREQ
Posts: 890

Re: A strange warning message about sgplot hbar

I looking at your example again, my guess would be that you have a high DPI set on the LISTING destination. If so, execute these statement before submitting your proc:

[pre]
ods listing close;
ods listing;
[/pre]

Thanks!
Dan
Contributor
Posts: 70

Re: A strange warning message about sgplot hbar

Cool! it works! but I have no idea about the high DPS set on the listing destination, I didn't set anything specifically. Thanks Dan.

But how about my second question: how to split the long yaxis string tick-mark value into multiple lines? I found one of your replies in this forum that is seemly related to this question. currently SAS has no way to do this? if so, that is very bad, SAS should have option to do that.
Contributor
Posts: 70

Re: A strange warning message about sgplot hbar

Thanks Dan. I didn't notice your first reply.

I tried to split the long string value in the following way, but the effect is not so satisfactory.

proc format;
value $itemfmt
'item1'='Easy access to supplies and\nequipment'
'item2'='Support services respond in\ntimely way'
'item3'='I am able to discuss challenging\nissues with team';
run;

proc sgplot data=MeanValue;
Xaxis label="Mean Score" values=(0 to 5 by 1);
yaxis label=" Items" ;
hbar Item / response=Avg;

format item $itemfmt.;
run;

The long string values did get split, but the distance of split lines is longer than that between each value. I maybe looks better if the distance between values is longer, but I don't know how to do that. Anyway this is just a reference for whoever really want to split the values.
Ask a Question
Discussion stats
  • 4 replies
  • 636 views
  • 0 likes
  • 2 in conversation