I'm more familiar with SGPLOT than GPLOT so
1. How do I set a reference line on the y-axis?
2. How do I change the color for values at or above a certain level?
First question is why Gplot?
Might help to show your existing code.
VREF=value or value list will draw reference lines perpendicular to the vertical axis (i.e. at Y axis values)
There are multiple other options to work with the VREF: CVREF to set colors, LVREF to set line type. WVREF to set line widths, and then a similar set for AUTOVREF if you want a reference line at each axis tick mark.
HREF and similar for the Horizontal axis.
Where a value list is used it looks like VREF= 300 1000 1500 to set 3 reference lines at Yaxis values of 300, 1000 and 1500.
It has been a long time since I used GPLOT much (think last century). If I wanted to change the color of a line plot based on a value then I would set a variable to different values for different ranges and match those values to SYMBOL statements. The kicker is going to be extra coding to avoid gaps if doing a line chart and Bubble charts would be a nightmare if you want to color only part of a bubble.
Don't use GPLOT. SGPLOT is so much better.
First question is why Gplot?
Might help to show your existing code.
VREF=value or value list will draw reference lines perpendicular to the vertical axis (i.e. at Y axis values)
There are multiple other options to work with the VREF: CVREF to set colors, LVREF to set line type. WVREF to set line widths, and then a similar set for AUTOVREF if you want a reference line at each axis tick mark.
HREF and similar for the Horizontal axis.
Where a value list is used it looks like VREF= 300 1000 1500 to set 3 reference lines at Yaxis values of 300, 1000 and 1500.
It has been a long time since I used GPLOT much (think last century). If I wanted to change the color of a line plot based on a value then I would set a variable to different values for different ranges and match those values to SYMBOL statements. The kicker is going to be extra coding to avoid gaps if doing a line chart and Bubble charts would be a nightmare if you want to color only part of a bubble.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.