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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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