BookmarkSubscribeRSS Feed
A_B_C
Calcite | Level 5


Hi,

x-axis order = (0 to 56 by 7) and y axis order=(0 to 120 by 10). I am displaying box using proc gplot. My graph have two outliers 44,40. but they are not visible.  when I change y - axis order to ( 0 to 63 by 7) then I was able to see the outliers. But I have to keep the y aixs order to ( 0 to 56 by 7) , then how do I get outliers visible in my graph. any help would be greatly appreciable.

5 REPLIES 5
ballardw
Super User

Code example would be helpful including any AXIS or SYMBOL statements.

Quentin
Super User

Hi,

One of my pet peeves with GPLOT is that it happily excludes data that is outside of the axis range, with only a mere note that data have been excluded from the plot. So:

data a;
  input x y;
  cards;
1 50
2 150
3 50
4 150
;
run;

symbol i=join;
axis1 order=(0 to 100 by 25);

proc gplot data=a;
  plot y*x/vaxis=axis1;
run;

Returns a straight horizontal line, with only the log notes to indicate something went wrog: line.

158  proc gplot data=a;
159    plot y*x/vaxis=axis1;
160  run;

NOTE: 2 observation(s) outside the axis range for the y * x request.

Seems odd to me that SAS will happily adjust title size, axis labels, etc, automatically, but won't adjust the axis range if you've defined one that is too small.  I don't know of a nice solution, other than to specify an axis range which includes all of your data.

--Q.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
A_B_C
Calcite | Level 5

Here is the code which am using..

Any help would be greatly appreciated..

goptions vsize=16cm hsize=24cm htext=1 device=gif;

options orientation=landscape;

axis1 order=(0 to 56 by 7);

axis2 order=(0 to 120 y 10);

symbol1 value=star i=boxjt mode=include color=blue  l=1;

symbol2 value=circle i=boxjt mode=include color=black l=2;

symbol3 value=triangle i=boxjt mode=include color=red l=3;

proc gplot data=xxxx;

  plot result*day=drugcode/haxis=axis1 vaxis=axis2;

run;quit;

Quentin
Super User

I think you will need to adjust your axis statement to accomodate the outliers.

You can do this dynamically by reading in the dataset before you run the GPLOT step, and finding the min and max value seen in the data.  Then pick a by value that makes sense, and write the min, max and by values  to macro variables to be used in your axis statement.

HTH,

--Q.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
ballardw
Super User

A_B_C wrote:

axis1 order=(0 to 56 by 7);
proc gplot data=xxxx;

  plot result*day=drugcode/haxis=axis1 vaxis=axis2;

run;quit;

From online help on the INTERPOL=BOX section of the SYMBOL statement:

Note:   If you use the HAXIS= or VAXIS= options in the PLOT statement or the ORDER= option in an AXIS definition to restrict the range of axis values, by default any observations that fall outside the axis range are excluded from the interpolation calculation.

Since you obviously have data outside of the desired axis you are not going to get it to display. You may need to provide a foot note that data exists outside of the display range.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 6873 views
  • 0 likes
  • 3 in conversation