%let gpath=C:\; ods html close; %let w=5in; %let h=2.5in; %let dpi=200; ods listing gpath="&gpath" image_dpi=&dpi; /*--Define some data--*/ data swimmer; input item stage $4-12 low high highcap $25-40 status $40-60 start end durable; startline=start; endline=end; if status ne ' ' then do; if end eq . then endline=high-0.3; if start eq . then startline=low+0.3; end; if stage eq ' ' then durable=.; ymin=-1; if durable then lowlabel='Durable'; datalines; 1 Stage 1 0 18.5 FilledArrow Complete response 6.5 13.5 -0.25 2 Stage 2 0 17.0 Complete response 10.5 17.0 -0.25 3 Stage 3 0 14.0 FilledArrow Partial response 2.5 3.5 -0.25 3 0 0 FilledArrow Partial response 6.0 10.5 -0.25 4 Stage 4 0 13.5 Partial response 4.0 7.0 . 4 0 0 Partial response 9.0 10.0 . 5 Stage 1 0 12.5 FilledArrow Complete response 3.5 4.5 -0.25 5 0 0 FilledArrow Complete response 6.5 8.5 -0.25 6 Stage 2 0 12.6 FilledArrow Partial response 2.5 7.0 . 6 0 0 FilledArrow Partial response 9.5 11.5 . ; run; /*--Define a Discrete Attributes Map*/ data attrmap; length ID $ 9 value linecolor markercolor fillcolor $ 20; input id $ value $10-30 linecolor $ markercolor $ fillcolor $; datalines; status Complete response darkred darkred gray status Partial response blue blue gray stage Stage 1 gray gray green stage Stage 2 gray gray yellow stage Stage 3 gray gray cxff6f00 stage Stage 4 gray gray darkred ; run; /*--Basic HighLow Bar plot--*/ ods graphics / reset width=&w height=&h imagename='HighLow_Y_Bar'; title 'Tumor Response Episodes by Stage'; proc sgplot data=swimmer noborder; highlow y=item low=low high=high / type=bar group=stage dataskin=pressed; yaxis display=none; xaxis display=(nolabel noline) grid; run; /*--HighLow Bar plot with Attr Map and caps--*/ ods graphics / reset width=&w height=&h imagename='HighLow_Y_Bar_Cap'; title 'Tumor Response Episodes by Stage'; proc sgplot data=swimmer noborder dattrmap=attrmap; highlow y=item low=low high=high / type=bar group=stage highcap=highcap dataskin=pressed attrid=stage transparency=0.3; yaxis display=none; xaxis display=(nolabel noline) grid; run; /*--HighLow Bar and Line plot with caps--*/ ods graphics / reset width=&w height=&h imagename='HighLow_Y_Bar_Line'; title 'Tumor Response Episodes by Stage'; proc sgplot data=swimmer noborder dattrmap=attrmap; highlow y=item low=low high=high / type=bar group=stage highcap=highcap dataskin=pressed attrid=stage name='stage' transparency=0.3; highlow y=item low=startline high=endline / group=status attrid=status lineattrs=(thickness=3 pattern=solid) name='status'; scatter y=item x=start / group=status markerattrs=(symbol=circlefilled) attrid=status name='start'; scatter y=item x=end / group=status markerattrs=(symbol=squarefilled) attrid=status name='stop'; yaxis display=none; xaxis display=(nolabel noline) grid offsetmax=0.2; keylegend 'stage'; keylegend 'status' 'Start' 'Stop' / location=inside position=topright across=1 linelength=20; run; /*--HighLow Bar and Line plot with cap and label--*/ ods graphics / reset width=&w height=&h imagename='HighLow_Y_Bar_Line_Label'; title 'Tumor Response Episodes by Stage'; proc sgplot data=swimmer noborder dattrmap=attrmap; highlow y=item low=low high=high / type=bar group=stage highcap=highcap dataskin=pressed attrid=stage name='stage' transparency=0.3 lowlabel=lowlabel labelattrs=(weight=bold color=black); highlow y=item low=startline high=endline / group=status attrid=status lineattrs=(thickness=3 pattern=solid) name='status'; scatter y=item x=start / group=status markerattrs=(symbol=circlefilled) attrid=status name='start'; scatter y=item x=end / group=status markerattrs=(symbol=squarefilled) attrid=status name='stop'; yaxis display=none; xaxis display=(nolabel noline) grid offsetmax=0.2; keylegend 'stage'; keylegend 'status' 'Start' 'Stop' / location=inside position=topright across=1 linelength=20; run; title;