The attached image shows the output from two sgplot statements. The syntax for the bottom (incorrect) image is below. The syntax for the (correct) top image is identical, except that the "max=18" text is omitted. (See, for example the point for 2010, it should be 13.1). Using the max statement seems to shift the axis down.
%let cl = curvelabel CURVELABELLOC=OUTSIDE CURVELABELPOS=max curvelabelattrs=(size=12);
proc sgplot data=medians_rates_comb;
label date="Year (Jan)";
series y=ABS_P50_AHY_C8_RcZS x=date
/lineattrs=(thickness=4 pattern=solid)
markers markerattrs=(size=8 symbol=circlefilled) &cl;
yaxis label="%" labelpos=center minor grid minorgrid
labelattrs=(size=14) valueattrs=(size=12) valuesformat=f3.1 min=5 max=18;
xaxis grid minor minorgrid labelattrs=(size=12) valueattrs=(size=12) ;
run;
Hello @BruceBrad,
@BruceBrad wrote:
(...) See, for example the point for 2010, it should be 13.1 ...
I have measured the y-coordinates of the tick marks and the point in question (in the bottom image) and obtained 13.14 for the value -- so no indication of a bug. Note that the y-axis tick mark label "13" may be a bit misleading because it is rounded up from 12.5 due to the insufficient width of the format specification
valuesformat=f3.1
No image attached. Please use the "Insert Photos" icon, rather than attaching a file.
I thought it had uploaded. Anyway here it is again. Actually, on a bit more reflection, it might be the min= statement that triggers the problem. I get the same problem recurring when extra data points push the axis higher. Now I'm using a values statement, which seems to work. But it seems to me that this is a bug.
Hello @BruceBrad,
@BruceBrad wrote:
(...) See, for example the point for 2010, it should be 13.1 ...
I have measured the y-coordinates of the tick marks and the point in question (in the bottom image) and obtained 13.14 for the value -- so no indication of a bug. Note that the y-axis tick mark label "13" may be a bit misleading because it is rounded up from 12.5 due to the insufficient width of the format specification
valuesformat=f3.1
"Note that the y-axis tick mark label "13" may be a bit misleading because it is rounded up from 12.5 due to the insufficient width of the format specification"
Well spotted! I didn't expect that would happen (and yes, the format should be wider).
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!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.