03-05-2012 02:43 PM
proc gplot data=whatever (obs=###)
Pick a number that represents enough observations for 20 or 30 plots, and ignore the last plot since it may be incomplete.
If you want a more scientific version, you could run through a DATA step to create a subset of your data:
if last.my_by_var then n_plots + 1;
if n_plots=25 then stop;
Then run PROC GPLOT on the subset.
03-05-2012 03:27 PM
Or, since your BY variable is in some kind of order, pick the one that's about 20th and use a WHERE statement:
where char_byvar le 'DEPT20';
where num_byvar le 54;
directly in your GPLOT:
proc gplot data=whatever;
03-05-2012 03:41 PM
I assume that you mean you have x values out of a desired range.
you can add an option to your plot statement (s) like: / haxis= value1 to value2 by increment
ro define an AXIS statement if you need more control and reference it:
This approach of restricting range usually generates a warning message if I remember correctly.
If your x values are dates or times some other bits come in how to specify them.
03-05-2012 03:47 PM
Thanks Ballardw, but I mean more like instead of showing 2000.01 ... 2000.02 ..... 2000.03 and so on, which crams it up.. I want to show only say years or quarters or something like 2000.01... 2000.06 that sort of thing.
03-05-2012 04:01 PM
hi ... have you tried just using a format , for example the dates in SASHELP.AIR have year and month but you can plot by year on the x-axis ...
proc gplot data=sashelp.air;
format date year.;
03-05-2012 06:55 PM
Actually my example does limit the number of displayed values as well as the range. The BY incremental value controls how many tick marks are displayed.
for examle haxis = 0 to 100 by 50 would have 3 major tick marks at 0, 50 and 100.
I looks like you may have x as a date value and a format of YYMMp8. You could try a YYQ to show year quarter values or YEAR. as MikeZdeb suggests.
03-05-2012 03:51 PM
hi ... if you know something about the values of the BY-variable, you can use a WHERE statement
for example ...
year = year(date);
proc gplot data=air;
where year between 1950 and 1952;
if you want to limit the output by the number of plots, you could try something like this ...
ods listing close;
proc sql number;
ods output sql_results=temp;
select distinct year from air;
ods output close;
select year into :years separated by ',' from temp where row le 5;
* generates 5 plots;
proc gplot data=air;
where year in (&years);