SAS 9.3 PROC SGPLOT yaxis values

Reply
Occasional Contributor
Posts: 17

SAS 9.3 PROC SGPLOT yaxis values

Good afternoon,

I am currently using SAS 9.3 and I have a question about PROC SGPLOT.  I am trying to have the yaxis display values from 0 to 10 be increments of 2, followed by a value of 20 and finally a value of 100.  I am using the following code:

     proc sgplot data=test;

          scatter x=mean y=cv/markerattrs=(symbol=circlefilled);

          series x=mean y=cv2;

          yaxis values=(0 to 10 by 2 20 100);

     run;

The output shows 0 to 10, and the 20, but then the 100 is not being displayed on the axis.  The rest of the yaxis is blank.  To me, it seems that the 100 tick mark is there, it is just off the graph.

What I would like to do is compress everything between 10 and 20, then again between 20 and 100 so that I can see the values between 0 and 10 and then the values at 20 and 100 on the yaxis.  Using PROC GPLOT, I can use the axis order option and make the changes that I want.  However, for this particular program, I am using SGPLOT.  The image below shows what a yaxis would look like when I use GPLOT.

SAS Gplot Yaxis.jpg

I saw that in SAS 9.4 there is a yaxis option of RANGES that could be used, but I can't seem to find anything in SAS 9.3.

Are there any suggestions on what I could do to resolve this?

SAS Super FREQ
Posts: 1,105

Re: SAS 9.3 PROC SGPLOT yaxis values

GPLOT is showing you a discrete axis, where the pixel distance between 10 and 20 is the same as between 20 and 100.  Your SGPLOT code will create a numeric scaled axis, where 2, 4, etc will be close together, and 100 far away.  It is possible some of the smaller values may collide, causing alternate values to get thinned.  If you do want the scaled numeric axis and see all values, set FITPOLICY=none.

 

If you really want a discerte axis like with GPLOT, then set the YAXIS TYPE=discrete, and then set the values on the axis as character values - "20" and so on.

SAS Super FREQ
Posts: 1,105

Re: SAS 9.3 PROC SGPLOT yaxis values

And, following up, FITPOLICY=none may not be available with SAS 9.3.

Ask a Question
Discussion stats
  • 2 replies
  • 4701 views
  • 0 likes
  • 2 in conversation