Does anyone have experience from printing thousands of SGPLOT graphs to paper?
I need to check approximately 3 500 timeseries of aggregated data to spot those that are less well behaved and therefore could hide some erroneous microdata. My idea is to put them on paper, say 21 graphs on each in 3 columns and 7 rows, and then glance through each paper to quickly discover those abnormal.
The timeseries are independent in the aspect that they do not share any axis. They should also be ordered on the paper so that each row is filled from left to right before moving to the next row. Each graph also needs to have its own heading to identify the variable plotted.
How can I arrange my ODS output so that each rendered graph will find its correct place on my paper? Does anyone have an idea?
Please also find attached a wordfile where I, for illustration, manually put the same timeseries graphs in each cell of a 3x7 table.
On ODS PDF statement you can specify the number of columns in a file.
Then you can control the size of graphics generated with ODS GRAPHICS statements.
The graphs will be created from top to bottom and then across the columns so your code needs to create the graphs in the correct order. That will create the PDF file with all your graphics.
%macro create_graphs(n=);
ods graphics / height = 2in width= 2in;
%do i=1 %to &n;
title "Graph &i.";
proc sgplot data=sashelp.class;
scatter x=height y=weight /group=sex;
run;
%end;
%mend;
ods pdf file='/home/fkhurshed/Demo1/sample1.pdf' columns=3 style = meadow startpage=no;
%create_graphs(n=12);
ods pdf close;
Even if you had 30 times series, I would plot them to some FILE and then scroll through them. The days of dumping large amounts of output to paper are long gone, and putting all of this on paper is inefficient and wasteful and environmentally unfriendly.
With 3500 anything, I think you need some computerized checking to look for "less well behaved and therefore could hide some erroneous microdata". What that computerized checking to use would be hard to determine, as "less well behaved" isn't really definitive enough to provide more information. But there are computerized outlier detection routines, and computerized checks for different time series types of problems, maybe that's a place to start. Or maybe some other testing is what you want.
PROC SGPLOT can plot all of your time series and send it to a file.
Thank you, PaigeMiller, for your interest in my problem.
To be more specific the problem I would like to solve is how to print timeseries graphs to a paper format ordered in rows and columns so that I can fit as many graphs as convenient on each page. I'm perfectly aware that I can print SGPLOT graphs to a file but I do not know how to order them in rows and coclumns.
As stated, you can get PROC SGPLOT to print in columns and rows. Why is this needed? Why couldn't you work with plots that are not in columns and rows?
You did not include any attachments, sample data or examples of output.
Thank you, Reeza, for your hint. I thought that I added an example of what I actually wanted but the file didn't seem to get through. I have now added it to this reply and I hope it will get through. I will also see if I can add some code examples later today or tomorrow.
On ODS PDF statement you can specify the number of columns in a file.
Then you can control the size of graphics generated with ODS GRAPHICS statements.
The graphs will be created from top to bottom and then across the columns so your code needs to create the graphs in the correct order. That will create the PDF file with all your graphics.
%macro create_graphs(n=);
ods graphics / height = 2in width= 2in;
%do i=1 %to &n;
title "Graph &i.";
proc sgplot data=sashelp.class;
scatter x=height y=weight /group=sex;
run;
%end;
%mend;
ods pdf file='/home/fkhurshed/Demo1/sample1.pdf' columns=3 style = meadow startpage=no;
%create_graphs(n=12);
ods pdf close;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.