user2105874
user2105874

Reputation: 41

Plotting large values in SGPLOT

I am plotting some data in sgplot where the y axis values are very large, from 178,254,700 to 900,000,000. SAS produces a plot where the values are labeled 2E8 - 8E8. I have tried to give a range using the value statement, but this doesn't solve the problem. I'd like to have the true values shown. How do I do this?

Upvotes: 1

Views: 1404

Answers (1)

Joe
Joe

Reputation: 63424

You need to adjust the format. Default format is BEST8., probably, which will automatically give you scientific notation in this context.

If you're talking data labels, usually you would change that in the dataset itself. I also show how to change the format of the axis labels (although in this case that is very uninteresting).

data largenumbers;
 call streaminit(7);
 do x = 1 to 10;
   y = 1e10*rand('uniform');
   output;
end;
format y 12.0;  *use 12 digits total, which leaves plenty of room, and no decimal;
run;

ods preferences;
proc sgplot data=largenumbers;
series x=x y=y/ datalabel;
yaxis valuesformat=best12.0; *Here is a bug - you cannot use w.d format here.  Annoying.;
run;

Upvotes: 0

Related Questions