BookmarkSubscribeRSS Feed
oussema
Obsidian | Level 7

Hello Folks, 

 

How to convert the following piece of code to proc template (I want to get circles as symbol and the color according to group):

 

proc sgplot data=sashelp.iris;
   scatter x=petallength y=petalwidth / group=species;
run;

 

Kind Regards,

 

 

2 REPLIES 2
ChrisHemedinger
Community Manager

I think you can accomplish this more simply without using PROC TEMPLATE.  Moving to the Graphics Programming board for more experts.  In the meantime, look at COLORMODEL and COLORRESPONSE options.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
DanH_sas
SAS Super FREQ

I am confused. The program you provided shoulld have given you exactly what you asked, unless you are using an ODS style that is not "color priority". Try this and see if it makes a difference:

 

ods graphics / attrpriority=color;
proc sgplot data=sashelp.iris;
   scatter x=petallength y=petalwidth / group=species;
run;

Hope this helps!

Dan

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
  • 2 replies
  • 785 views
  • 1 like
  • 3 in conversation