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.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: 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.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: 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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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