BookmarkSubscribeRSS Feed
_Hopper
Obsidian | Level 7

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?

2 REPLIES 2
WarrenKuhfeld
Ammonite | Level 13

Don't use GPLOT. SGPLOT is so much better.

ballardw
Super User

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.

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 54 views
  • 0 likes
  • 3 in conversation