Hi all,
Could you please help to modify Reference line on the graph below. The issue is the reference line extends beyond timepoints where values of concentration do not exist.
The code that was used is here:
proc sgplot data=abc;
where col1 = "&&sub&i";
styleattrs AXISBREAK=Bracket;
series x=col3 y=col4/ lineattrs=(pattern=solid color=blue) name="line" markers markerattrs=(symbol=circlefilled color=blue size=6);
xaxis label='Timepoint (hrs)' type=linear values = (0 to &&xmax&i. by 12)
integer valueattrs=(size=8pt) fitpolicy = rotate integer valuesrotate=vertical;
yaxis label='Semi-log Concentration'
type=log logbase=10 logstyle=linear logvtype=expanded values = (0.1 1 10)
THRESHOLDMin=1 THRESHOLDMAX=1;
refline col7 /axis=y lineattrs=(color=red) name = "line1" legendlabel = "Mean X-response";
keylegend "line" "line1" / location=inside position=topright across=1 noborder;
run;
Do any options for refline exist to modify it?
Thank you!
As far as I am aware the refline will fill across the width or height of the axis - it is a reference line at the end of the day. What you could do is just overlay a series plot of x=0, y=col7 and x=60, y=col7.
Just add it to your where clause then:
where col1 = "&&sub&i" and col4 ne .;
Also note, you don't need the macro looping - which I can infer from the &&sub&i, you can use by grouping:
@DmytroYermak wrote:
The matter is that the timepoint "72 hours" exists with <null> value of concentration.
?????
I always get confused when people reference "null" in SAS discussions since SAS uses the term "missing".
And why no complaint about the reference line showing at x=0?
Old school solution would be create another plot series with matching x values that start and end with corresponding values of y with the refline value.
Of course if the refline is changing for each level of your macro variable that could lead to some mildly entertaining code.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.