turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS/GRAPH and ODS Graphics
- /
- Output sgplots from multiple datasets into a singl...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2017 09:59 AM

I'd like to output two plots from these two different datasets to a single plot (side to side). Tried panelling with no success yet. Tried "thickness=n" to bolden up the lines a bit. No success yet, again. Any ideas for both issues? Using SAS 9.4.

```
title "MODEL FIT TO DUPLICATE DATA";
proc sgplot data=mydata1;
step x=ECDFX y=ECDFY / legendlabel="ECDF";
step x=ECDFX y=NBCDF / legendlabel="Model Fit to Negative Binomial / Duplicated Data";
step x=ECDFX y=PoisCDF / legendlabel="Model Fit to Poisson / Duplicated Data";
xaxis grid label="Rate" offsetmin=0.0 offsetmax=0.0 min=0 max=80;
yaxis grid min=0 label="Cumulative Proportion";
run;
title "MODEL FIT TO UNIQUE ENTITY DATA";
proc sgplot data=mydata2;
step x=ECDFX y=ECDFY / legendlabel="ECDF";
step x=ECDFX y=NBCDF / legendlabel="Model Fit to Negative Binomial / Unique Entity Data";
step x=ECDFX y=PoisCDF / legendlabel="Model Fit to Poisson / Unique Entity Data";
xaxis grid label="Rate" offsetmin=0.0 offsetmax=0.0 min=0 max=80;
yaxis grid min=0 label="Cumulative Proportion";
run;
```

S

Accepted Solutions

Solution

04-27-2017
03:50 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2017 10:14 AM

Yes, use graph template language - you can get most ot the code by adding:

```
proc sgplot data=mydata1 tmplout="c:\temp.txt";
```

In and looking at the created temp.txt file. You can see a vast array of graphs, all different types/techniques with code examples in template, sgplot by looking at Sanjay's blog:

http://blogs.sas.com/content/graphicallyspeaking/

It contains almost every graph you can think of, so copy the code from there.

All Replies

Solution

04-27-2017
03:50 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2017 10:14 AM

Yes, use graph template language - you can get most ot the code by adding:

```
proc sgplot data=mydata1 tmplout="c:\temp.txt";
```

In and looking at the created temp.txt file. You can see a vast array of graphs, all different types/techniques with code examples in template, sgplot by looking at Sanjay's blog:

http://blogs.sas.com/content/graphicallyspeaking/

It contains almost every graph you can think of, so copy the code from there.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-26-2017 12:40 PM

If the graphs are independent, you can place them side by side in a document like PDF or RTF using the ODS LAYOUT statement along with the ODS REGION statements. If you really want the graphs in one PNG file, you should really use GTL, with a LAYOUT LATTICE. See SASGF 2016 paper "Up Your Game with GTL Layouts". See topic "CREATING MULTI-CELL GRAPH WITH LAYOUTS LATTICE" on page 9.