- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I made a series plot by group. In the results window, all of the lines are solid, but in the .png output, two lines are dashed. I can't figure out what part of the code is doing that.
ods listing gpath='&path'; ods graphics on / reset=all noborder imagename="plot" imagefmt=png; title1 c=gray33 h=14pt "Title"; proc sgplot data=month_total aspect=1; series x=month y=total / smoothconnect group=gr name="a" markers markerattrs=(symbol=squarefilled size=3pt); where date_ < 22554; xaxis values=(1 to 12) valuesdisplay=('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' '') valueattrs=(color=gray33 size=10pt) label="payment month"; yaxis label="total" valueattrs=(color=gray33 size=10pt); keylegend "a" / noborder position=right; run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Different destinations will have different style defaults and will look different. To avoid this you can be more specific in your code. For example, if you want all solid lines in any output add LINEATTRS=(pattern=solid) to your series statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
https://documentation.sas.com/doc/en/pgmsascdc/v_017/statug/statug_odsgraph_sect048.htm
ODS styles control appearances, and default styles differ for html, pdf, rtf, listing, and so on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Different destinations will have different style defaults and will look different. To avoid this you can be more specific in your code. For example, if you want all solid lines in any output add LINEATTRS=(pattern=solid) to your series statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The LISTING style uses ATTRPRIORITY=NONE, which will allow more than one attribute change per group (in this case, color and pattern). The default style for HTML output is HTMLBlue, which is set to ATTRPRIORITY=COLOR. In that case, all of the colors are exhausted before rotating the other attribute. To get the two outputs to look the same, do this:
ods listing style=HTMLBlue;
Hope this helps!
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
For more on the ATTRPRIORITY= option, see this article by Sanjay Matange or this article by Warren Kuhfeld.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can. You can add ATTRPRIORITY to the BEGINGRAPH statement in your GTL template.