BookmarkSubscribeRSS Feed
Happydragon
Calcite | Level 5

I meet a issue in work. client ask a plot like below.

the first way I do is using PROC SGPANEL. But the issue is , I can't show the x-axis and y-axis in each small cell. additional, there is a blank cell at the bottom right. I don't know how to remove it.

the second way, using PROC GPLOT to draw each subject, than use GREPLAY to put them together. but the issue is ,how to draw the legend?

Is anyone have a good solution for this?

thanks a lot!

Untitled.png

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

Try out proc template and GTL as you will have more control.

Also, have a look at this blog which details quite a lot with regards to graphs: http://blogs.sas.com/content/graphicallyspeaking/

jwillis
Quartz | Level 8

Happydragon,

Robert Allison has some great information on the Web (google); in SAS sites; and in his book "SAS/GRAPH Beyond the basics".  I have seen or encountered each of your problems. The documentation by Robert Allison and others helped me solve the problems.  Unfortunately, there was no quick fix for my problems.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

GraphGuy
Meteorite | Level 14

Assuming you've got the gplots & greplay looking the way you want, and the only remaining question is the shared legend, here is an example that should be exactly what you need...

http://robslink.com/SAS/democd53/multi_plot.htm

http://robslink.com/SAS/democd53/multi_plot_info.htm

(p.s. - Thanks jwillis!)

Happydragon
Calcite | Level 5

I have visited your website before. There are a lot of example which are useful to us. thanks very much!

You link is a good way to resolve by gplot and greplay.

But I am more interested in GTL. Because I have got original plot by GPANEL. the plot is much more complex than the sample I show. it will be a lot work to change it to use gplot.

About GTL, which layout should I chose? I have look into the GTL early. for multi-cell layouts, LATTICE can be use. but in documents, 'All cells must be predefined'. does this mean I have to define 5 times if there are 5 cells in one graph? And in early test, if I define 2 cells, and if there is no data for second cell, the blank frame will still show.

about DATAPANEL and DATALATTICE, it is sample. But I think this is same as SGPANEL, right?

DanH_sas
SAS Super FREQ

You best choice for this type of plot is PROC SGSCATTER.

proc sort data=sashelp.cars out=cars; by msrp; run;

proc sgscatter data=cars (obs=50);

plot (weight horsepower mpg_city mpg_highway)*msrp / group=type join;

run;

SGScatter.png

DanH_sas
SAS Super FREQ

After looking at your example further, it looks like you need reference lines, which are not currently supported in SGSCATTER. Therefore, you would need to use either GTL or the GPLOT/GREPLAY combo.

Happydragon
Calcite | Level 5

Yes. actually, each small plot is more complex than the sample. I think it can't support by SGSCATTER.

And I am more interested in GTL.

Happydragon
Calcite | Level 5

Here is another graph I need to draw. it is more complex. I created it by SGPANEL. but at last page, there is a blank cell which need be removed. and client ask to add x-axis if it is possible.  So I try to resolve it by GTL.

无标题.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 1520 views
  • 0 likes
  • 5 in conversation