BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
BruceBrad
Lapis Lazuli | Level 10

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) ; Screenshot 2025-08-22 220655.png run;
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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

 

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

No image attached. Please use the "Insert Photos" icon, rather than attaching a file.

PaigeMiller_0-1755865510560.png

 

--
Paige Miller
BruceBrad
Lapis Lazuli | Level 10

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. 

FreelanceReinh
Jade | Level 19

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

 

BruceBrad
Lapis Lazuli | Level 10

"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).

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 5 replies
  • 426 views
  • 0 likes
  • 3 in conversation