- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Nobody can test or run your template without some sample data.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dan,
That was it.