BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

I am generating scatter plot with xerrorlower and yerrorlower (ranges) . How to fill up with color low to high .

Note: first line (range) is base for remaining records.
For you reference I am attaching one photo.

graph_photo.png

1 REPLY 1
Rick_SAS
SAS Super FREQ

You can use the COLORRESPONSE= option on the SCATTER statement to color the markers and bars according to some variable in your data set. In the following, I color by using the mean value:

 

data confidence;
input Var $ 1-2 Mean  LowerCI UpperCI;
datalines;
X1      1.2     0.1     4.2
X2      1.2     0.1     4.2
X3      50.0    48.7    60.3
X4      6.0     5.0     7.3
X5      6.1     5.0     7.3
X6      16.7    0.4     64.1
X7      66.4    55.2    69.6
;

proc sgplot data=confidence;
  scatter y=Var x=mean / xerrorupper=upperci xerrorlower=lowerci colorresponse=mean
          markerattrs=(symbol=CircleFilled) errorbarattrs=(thickness=2);
  yaxis grid;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 497 views
  • 0 likes
  • 2 in conversation