Hi, I tried to add curvelabels to several regression lines. As mentioned above, I used "regressionplot" and "group=" option. The "group=" option conflicted with the "curvelabel=" option. I may also nested "drawtext" in the layout overlay. But if I want to change the size of the figure, the nested "drawtext" will not automaticly fit the size. Is there a better way to fix this problem? Regards, ttmei My code: proc template;
define statgraph ttmei;
begingraph /designwidth=700px designheight=300px border=false;
discreteattrmap name="scatter1" /ignorecase=true;
value "600-650" / markerattrs=(symbol=circle size=8 color=blue) lineattrs=(thickness=2 color=blue);
value "650-700" / markerattrs=(symbol=circle size=8 color=cxff00ff) lineattrs=(thickness=2 color=cxff00ff);
value "700-750" / markerattrs=(symbol=circle size=8 color=orange) lineattrs=(thickness=2 color=orange);
value "750-800" / markerattrs=(symbol=circle size=8 color=green) lineattrs=(thickness=2 color=green) ;
value "800-850" / markerattrs=(symbol=circle size=8 color=black) lineattrs=(thickness=2 color=black) ;
value "850-900" / markerattrs=(symbol=circle size=8 color=brown) lineattrs=(thickness=2 color=brown) ;
value "900-950" / markerattrs=(symbol=circle size=8 color=yellow) lineattrs=(thickness=2 color=yellow) ;
value "950-1000" / markerattrs=(symbol=circle size=8 color=red) lineattrs=(thickness=2 color=red) ;
value "1000-1100" / markerattrs=(symbol=circle size=8 color=purple) lineattrs=(thickness=2 color=purple) ;
value "1100-1300" / markerattrs=(symbol=circle size=8 color=darkgreen) lineattrs=(thickness=2 color=darkgreen) ;
discreteattrvar attrvar=scatter var=dor attrmap="scatter1";
layout lattice /rows=1 columns=2;
layout overlay/
yaxisopts=(display=(ticks tickvalues line) offsetmin=0.1 offsetmax=0 tickvalueattrs=(FAMILY="Arial" SIZE=10pt)
linearopts=(viewmin= 0 viewmax=0.6 thresholdmin=0) labelattrs=(FAMILY="Arial" SIZE=10pt))
xaxisopts=(display=(ticks tickvalues line) offsetmin=0 offsetmax=0 tickvalueattrs=(FAMILY="Arial" SIZE=10pt)
linearopts=(viewmin= 0 viewmax=1 thresholdmin=0) labelattrs=(FAMILY="Arial" SIZE=10pt));
scatterplot y=kx x=Mf/group=scatter name="dot1";
regressionplot y=kx x=Mf/group=scatter name="line1";
/* mergedlegend "dot1" "line1"/title="Dry density" exclude=( "500-600" "1400-1700" ".") location=inside border=false across=2 halign=right valign=bottom*/
/* valueattrs=(size=10); */
entry halign=left "(A)"/location=inside valign=top textattrs=(family="Arial" size=10pt) ;
endlayout;
layout overlay/
yaxisopts=(display=(ticks tickvalues line label) label="Tc/Dd" offsetmin=0 offsetmax=0 tickvalueattrs=(FAMILY="Arial" SIZE=10pt)
linearopts=(viewmin= 0.2 viewmax=0.8 thresholdmin=0) labelattrs=(FAMILY="Arial" SIZE=10pt))
xaxisopts=(display=(ticks tickvalues line) offsetmin=0 offsetmax=0 tickvalueattrs=(FAMILY="Arial" SIZE=10pt)
linearopts=(viewmin= 0 viewmax=1 thresholdmin=0) labelattrs=(FAMILY="Arial" SIZE=10pt));
scatterplot x=mf y=cd/ markerattrs=(symbol=circle size=8 color=black);
regressionplot x=mf y=cd/lineattrs=(thickness=2 color=black) ;
entry halign=left "(B)"/location=inside valign=top textattrs=(family="Arial" size=10pt) ;
layout gridded/columns=1 rows=2 location=inside halign=right valign=bottom;
entry halign=right "Y=0.32X+0.31"/
textattrs=(family="Arial" size=10pt);
entry halign=right "R"{sup '2'}"=0.99; P<0.05"/
textattrs=(family="Arial" size=10pt);
endlayout;
endlayout;
rowheaders;
entry "Tc (W m" {sup '-1'} " K" {sup '-1'}")" /rotate=90 textattrs=(family="Arial" size=10pt);
endrowheaders;
sidebar / align=bottom;
entry halign=center "Wc (g g"{sup '-1'}")"/valign=bottom location=outside
textattrs=(FAMILY="Arial" SIZE=10pt) pad=(bottom=8px);
endsidebar;
endlayout;
endgraph;
end;
run;
ods html image_dpi=300 ;
proc sgrender data=tcmax.tc template="ttmei" ;
run;
... View more