BookmarkSubscribeRSS Feed
hdg
Obsidian | Level 7 hdg
Obsidian | Level 7

Hello,

I am trying to do the following I have a dataset with different clustypes. Currently I am plotting each type separately

I would like to do the following

1. Have the charts arranged in a panel with the type in the header of each panel. Main title in the top

2. Output charts in a pdf file  - the  panel first and then followed by each individual chart

Here is a sample data; this shows only two clustering algorithms but I could have 10 or so so I would like to have some flexibility in setting up the panel. I am not sure how to do this any help is appreciated!!

Thanks!

data clusters;

   input clustype$ code$ id rsqw rsqa size;

   datalines;

median a 1 0.8 0.4  1

median b 1 0.85 0.2 1

median c 2 0.4 0.1  2

median d 3 0.9  0.2 2

single a 1 0.8 0.4  1

single b 1 0.85 0.2 1

single c 2 0.4 0.1  2

single d 3 0.9  0.2 2

;

run;

%let clustype = single;

data filter;

set clusters;

if clustype = "&clustype";

run;

data anno_bubbles; set filter;

length function color $8;

xsys='2'; ysys='2'; hsys='3'; when='b';

x=rsqw; y=rsqa;

function='pie'; rotate=360;

size=size;

if id = 1

then color='#5F9F9F';

if id = 2

then color='#856363';

if id =3  then color='#CD7F32';

if id =4  then color='#9F9F5F';

if id =5  then color='#5F9F9F';

if id =6  then color='#ADEAEA';

if id =7  then color='#B5A642';

if id =8  then color='#B87333';

if id =9  then color='#BC8F8F';

if id =10  then color='#4F2F4F';

style='psolid'; output;

style='pempty'; color='grayaa'; output;

function='label'; position='2'; size=1.0; text=code;

style=''; color=''; rotate=.; output;

run;

title1 ls=1.5 "&clustype";

symbol1 value=none interpol=none;

axis1 label=(angle=90 "Rsq Within")

order=(0.1 to 1 by 0.05) minor=none offset=(5,5);

axis2 label=("Rsq Across")

order=(0.1 to 1 by .05) minor=none offset=(5,5);

proc gplot data=filter anno=anno_bubbles;

plot rsqw*rsqa /

vaxis=axis1 haxis=axis2;

run;

1 REPLY 1
GraphGuy
Meteorite | Level 14

I'm not sure how to do it in pdf output, but if html output would be ok then you could use htmlpanel'ing.

Here's an example:

 

http://robslink.com/SAS/democd_mpg/gas_class_2017.htm

http://robslink.com/SAS/democd_mpg/gas_class.sas

 

htmlpanel.png

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1066 views
  • 0 likes
  • 2 in conversation