I try to create Vertical BAR (Red) width specified width (Study Day)(YAxis) for all Subjects(Yaxis) Swimmer Plot.
HighLowPlot Y = Subject High = REFENDY Low = REFSTDY / Type = BAR BARWIDTH = 1 HighCap = NONE Primary = True Display=(FillPattern) FillPatternAttrs=(Pattern=L1 Color=LightRed) FillAttrs = (Color = LightGreen Transparency=0.6) LegendLabel="Washout Window" Name="washout" ;
Problem is that red lines in FillPattern doesn't match for different Subjects.
Someone know another method, how to draw such red vertical rectangle?
Problem is that red lines in FillPattern doesn't match for different Subjects.
I don't understand your question ,can you explain it more details ?
And I am running your code and get the red line rectangle.
options validvarname=any; proc format; value _trt /*组别的Format*/ 1='4 mg/kg Combination' 2='6 mg/kg Combination' 3='10 mg/kg Combination' ; picture _time /*治疗开始时间 治疗结束时间的Format*/ 0='Baseline'(noedit) other='009'(prefix='Week ') ; run; data swimmer; *治疗开始时间 治疗结束时间 以月,周,天 等为单位 ; input Subjid 组别 治疗开始时间 治疗结束时间 CR PR SD PD 继续时间 start end ; /*继续时间 是 治疗结束时间*/ format 组别 _trt. 治疗开始时间 治疗结束时间 _time. ; 继续时间=继续时间+0.5; datalines; 1 1 0 22 6 13 3 15 . 5 10 2 2 0 17 10 17 7 . 17 5 10 3 3 0 14 2 3 . 12 . 5 10 4 2 0 13 7 11 1 10 . 5 10 5 1 0 12 3 4 . 8 12 5 10 6 2 0 12 2 7 3 . 12 5 10 7 3 0 11 4 11 14 8 11 5 10 8 1 0 9 1 9 . 12 . 5 10 9 1 0 8 6 . 4 10 8 5 10 10 2 0 4 1 . 2 3 4 5 10 ; run; %sganno title 'xxxxxxxxxxxxxxx'; proc sgplot data= swimmer; styleattrs datacolors=(lightbrown lightgreen lightblue); symbolchar name=arrow char='2192'x/scale=2; highlow y=subjid low=治疗开始时间 high=治疗结束时间 /type=bar group=组别 fill nooutline lineattrs=(color=black) nomissinggroup ; scatter y=subjid x=CR / markerattrs=(symbol=circlefilled size=10 color=yellow) legendlabel='CR' ; scatter y=subjid x=PR / markerattrs=(symbol=circlefilled size=10 color=red) legendlabel='PR' ; scatter y=subjid x=SD / markerattrs=(symbol=circlefilled size=10 color=blue) legendlabel='SD' ; scatter y=subjid x=PD / markerattrs=(symbol=circlefilled size=10 color=gray) legendlabel='PD' ; scatter y=subjid x=继续时间 / markerattrs=(symbol=arrow size=14 color=black) legendlabel='On Treatment' ; HighLow Y = subjid High = end Low = start / Type = BAR BARWIDTH = 1 nooutline FillPattern FillPatternAttrs=(Pattern=L1 Color=LightRed) FillAttrs = (Color = LightGreen Transparency=0.6) ; xaxis label=' ' valueshint; yaxis display=(noticks novalues noline) reverse label='Subjects Received Study Drug'; keylegend /title=' ' noborder location=inside position=bottomright across=1; run;
I mean this joints.
@TimurShangareev wrote:
I mean this joints.
Looks like you really need to include your entire code because that appears as if you are creating a separate rectangle for each subject and not a block over all the subjects that appears to be more the expected case with multiples subjects all having the same overlay.
For best results when asking about specific output you should:
1) include some example data in the form of a working data step that behaves like your actual data
2) provide ALL the graphics procedure code as some options may not work with options invoked by statements not shown
and 3) include a very clear description of what you are expecting to create for the given example data.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.