BookmarkSubscribeRSS Feed
fastb
Fluorite | Level 6


I'm using an macro in SGPLOT to create graphs (code attached) and I want to specify the minimum and maximum values of the y axis.

Data for the graphs comes from the data set macrovar, which includes the variables Ymin, Ymax, and Yint.

When the graphs are created, they have the interval that I have specified with Yint, but the maximum value for the Yaxis is not what I have specified with the Ymax variable.

In the attached example graph, the maximum is just a little bit above 85.  However, I have specified that the max for the Y axis needs to be 93.5.  Why is it not using the values I have specified for Ymax?  Any help figuring this out would be greatly appreciated!

code.JPG

graph example.JPG

3 REPLIES 3
Andre
Obsidian | Level 7

Fastb,

Hypothesis to verify!

1)Was there an interaction between your title defined with a title area  with move(14,-10) ?

2)what happens if you change into  ods graphics /height=20 cm;

3) an effect of offsets ?

Andre

Jay54
Meteorite | Level 14

I believe you are using the right (VALUES) option.  You could additionally try the MIN and MAX options on the Y axis.  Hard to say without the data and with the macro variables.

DanH_sas
SAS Super FREQ

If you add the VALUESHINT option, I believe you will get what you want. By default, the axis will be constrained by the min/max values in the VALUES option. However, if you also specify VALUESHINT, the axis will not be constrained, and the tick values from the VALUES option that fall within the axis range will be drawn.

Hope this helps!

Dan

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 12240 views
  • 0 likes
  • 4 in conversation