Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FredGIII
Quartz | Level 8

Hi everyone,

 

Created a scatterplot graph in ODS Graphics designer where each group by category uses a different symbol.  The graph works great in Graphics Designer and generates the template code.  When I copy the template and run it in SAS Studio, I get the correct graph, but all the symbols are now the same (all circles).  So far I have not found reference as to why or how to change it in SAS Studio to run correctly.  Any suggestions?

 

Regards,


Fred

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

This is not a code issue -- it's an ODS style issue. The style you used in Designer probably defaulted to ATTRPRIORITY=NONE, which means colors, symbols, and line patterns all rotate together. The default style for ODS HTML is HTMLBLUE, which is set up to be ATTRPRIORITY=COLOR, which means cycle through all colors BEFORE moving to the next symbol or line pattern. The override for this is simple. Add this statement to your code:

 

ods graphics / attrpriority=none;

 

This will override the style setting.

 

Hope this helps!

Dan

View solution in original post

5 REPLIES 5
ballardw
Super User

Code? The template and the graphic procedure using the template as a minimum to have a chance of answering this sort of question.

 

 

Consider if I asked you "why are the markers on my graph pink" without showing and code. Where would you begin? Lots of guesses but showing code would reduce them.

FredGIII
Quartz | Level 8

Good point.  I thought maybe the generic nature of the problem - ie template/code generated by Graphics Designer not running the same in Studio might spark an idea.  But here is the code generated by Graphics Designer.  This template code works in both the Graphics Designer and in Studio but in Studio the symbols for all groups are the same (circles).  

 

Regards,

F

 

ods graphics /reset=all;

ods graphics on;

 

proc template;

define statgraph Graph2;

dynamic _SUBSYSTEM _PROB_SAME_SUBSYSTEM _FSA_MODEL;

begingraph / designwidth=784 designheight=593 DataSymbols=(CIRCLE PLUS X TRIANGLE SQUARE ASTERISK DIAMOND);

   entrytitle halign=center 'Probability of Seeing Another SR from same Subsystem within 1 week';

   layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;

      layout overlay / xaxisopts=( label=('Repeat Subsystem') labelattrs=(style=NORMAL weight=BOLD ) discreteopts=( tickvaluefitpolicy=splitrotate)) yaxisopts=( griddisplay=on label=('Probability of Occurance') labelattrs=(style=NORMAL weight=BOLD ));

         scatterplot x=_SUBSYSTEM y=_PROB_SAME_SUBSYSTEM / group=_FSA_MODEL name='scatter' markerattrs=(size=9 );

         discretelegend 'scatter' / opaque=false border=true halign=right valign=top displayclipped=true across=1 order=rowmajor location=inside;

      endlayout;

   endlayout;

endgraph;

end;

run;

 

proc sgrender data=work.PROB_NEXT_SR template=Graph2;

dynamic _SUBSYSTEM="SUBSYSTEM" _PROB_SAME_SUBSYSTEM="'PROB_SAME_SUBSYSTEM'n" _FSA_MODEL="'FSA_MODEL'n";

run;

ods graphics off;

Cynthia_sas
SAS Super FREQ
Hi:
Nobody can test or run your template without some sample data.
Cynthia
DanH_sas
SAS Super FREQ

This is not a code issue -- it's an ODS style issue. The style you used in Designer probably defaulted to ATTRPRIORITY=NONE, which means colors, symbols, and line patterns all rotate together. The default style for ODS HTML is HTMLBLUE, which is set up to be ATTRPRIORITY=COLOR, which means cycle through all colors BEFORE moving to the next symbol or line pattern. The override for this is simple. Add this statement to your code:

 

ods graphics / attrpriority=none;

 

This will override the style setting.

 

Hope this helps!

Dan

FredGIII
Quartz | Level 8

Thanks Dan,

 

That was it.  

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1349 views
  • 1 like
  • 4 in conversation