BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kritima
Obsidian | Level 7

Dear all,

 

I run this sas code


proc sgplot data=sashelp.iris;
title 'Fisher (1936) Iris Data';
styleattrs datasymbols=(circlefilled squarefilled starfilled);
scatter x=petallength y=petalwidth / group=species markerattrs=(size=5px);
run;

 

expect to see  CIRCLEFILLED , SQUAREFILLED , STARFILLED

 

but i have gotten as below 

 

Would you please suggest me what's happen?

* I use SAS9.4 with Windows 10


ScreenHunter_80 Sep. 08 16.03.jpg
1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

 

You have to set the ATTRPRIORITY= option with the ODS GRAPHICS statement, see example below

 

ods graphics / attrpriority=none;

proc sgplot data=sashelp.iris;
  title 'Fisher (1936) Iris Data';
  styleattrs
    datasymbols=(circlefilled squarefilled starfilled)
  ;
  scatter x=petallength y=petalwidth / group=species markerattrs=(size=5px);
run;

Bruno

View solution in original post

2 REPLIES 2
BrunoMueller
SAS Super FREQ

Hi

 

You have to set the ATTRPRIORITY= option with the ODS GRAPHICS statement, see example below

 

ods graphics / attrpriority=none;

proc sgplot data=sashelp.iris;
  title 'Fisher (1936) Iris Data';
  styleattrs
    datasymbols=(circlefilled squarefilled starfilled)
  ;
  scatter x=petallength y=petalwidth / group=species markerattrs=(size=5px);
run;

Bruno

DanH_sas
SAS Super FREQ

Just to comment further on Bruno's correct answer, the reason you need that option in this case is that the default ODS style for HTML output is HTMLBlue. In that particular style, the ATTRPRIORITY is explicitly set to COLOR, which means all of the style colors are exhausted before moving to the next marker symbol or line pattern. The option on the ODS GRAPHICS statement overrides the style setting. Most of the other ODS styles do not set this option, but setting the option on the ODS GRAPHICS statement will guarantee the behavior you want. 

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
  • 1561 views
  • 6 likes
  • 3 in conversation