Data visualization with SAS programming

Why does the DATALINEPATTERNS option not work in the SGPLOT procedure

Reply
Contributor
Posts: 58

Why does the DATALINEPATTERNS option not work in the SGPLOT procedure

Hi there,

 

I have the SGPLOT code below. However, the datalinepatterns option could not work. The output plot lines are still all solid. Does any one know how to change the line style? I want two solid lines and two dot lines.

 

Thank you!

 

proc sgplot data=forplotfinal;
styleattrs datacontrastcolors=(blue red blue red) datalinepatterns=(solid dot solid dot);
series x=index_time y=stat/lineattrs=(thickness=4)group=group2;
scatter x=index_time y=cohort/ markerchar=remaining2 markercharattrs=(size=8 weight=bold) y2axis group=cohort;
where cancern=1;
xaxis values=(-12 to 12 by 2 );
yaxis values=(0 to 22500 by 2500) offsetmin=0.2 min=0;
y2axis offsetmax=0.9 display=none min=1 max=2;
run;

Attachment
Respected Advisor
Posts: 3,768

Re: Why does the DATALINEPATTERNS option not work in the SGPLOT procedure

Does this option have any effect?

 

ods graphics / attrpriority=none;
Contributor
Posts: 58

Re: Why does the DATALINEPATTERNS option not work in the SGPLOT procedure

YES!!!! It works!! Thank you very much!!!

SAS Super FREQ
Posts: 1,042

Re: Why does the DATALINEPATTERNS option not work in the SGPLOT procedure

That implies that (somehow) you were using HTMLBlue as your style.  HTMLBlue uses AttrPriority=Color, which favors color change over patterns.

Post a Question
Discussion Stats
  • 3 replies
  • 66 views
  • 1 like
  • 3 in conversation