You can request SAS to create a dataset from the plot data it uses for built in plots. You can use the ODS TRACE commands to find the name(s) of the objects. Here is an example using a data set you should have available and Proc Freq.
First turn on ODS graphics, set the trace option.
ods graphics on;
ods trace on;
proc freq data=sashelp.class;
tables age /plots=freqplot;
run;
ods trace off;
ods graphics off;
The TRACE generates output like this in the log, the names and details will change for each procedure.
Output Added:
-------------
Name: OneWayFreqs
Label: One-Way Frequencies
Template: Base.Freq.OneWayFreqs
Path: Freq.Table1.OneWayFreqs
-------------
Output Added:
-------------
Name: FreqPlot
Label: Frequency Plot
Template: Base.Freq.Graphics.OneWayFreqChart
Path: Freq.Table1.OneWayFreqPlots.FreqPlot
-------------
In this case it is pretty obvious only one plot object is created FREQPLOT.
So add an ODS OUTPUT statement, could appear immediately before the procedure or in the body of the procedure code such as:
ods graphics on;
proc freq data=sashelp.class;
tables age /plots=freqplot;
ods output freqplot=work.freqplot;
run;
ods graphics off;
The data used to create the plot will appear in the WORK.FREQPLOT data set.
Depending on the procedure you may need to filter the data or modify it so look closely at any of your output. If there were two or more variables on the tables statement there will be values of TABLE in the output set for each variable.
And for most things if the other data is in SAS I would combine the data and use SGPLOT to overlay multiple plots. Especially if I were doing a large number of them.
... View more