Data visualization with SAS programming

Use Multiple Colors in a Graph

Accepted Solution Solved
Reply
Regular Contributor
Posts: 220
Accepted Solution

Use Multiple Colors in a Graph

I am attempting to make a "waterfall" plot with the NEEDLE interpolation in PROC GPLOT.  My plot is divided into two different groups.  I wanted the positive group to be blue and the negative group to be red.  Here is what I have attempted:

axis1 label=(angle=90 'Best Percent Change in Lesion Size') order=(-100 to 150 by 50) minor=(n=4);

axis2 label=(' ') value=none major=none minor=none;

proc gplot data=waterfall;

     plot ploty1*n ploty2*n / overlay vaxis=axis1 haxis=axis2;

     symbol1 interpol=Needle value=none width=4 color=blue;

     symbol2 interpol=Needle value=none width=4 color=red;

run;

I am not at all familiar with annotations, but I am sure I could do something with that.  I just have no idea where to start.

This is not my full data, but here is an idea of how it looks:

brpercentposnegnploty1ploty2
2.564Positive12.564
2.083Positive22.083
1.333Positive31.333
0Positive40
-5.263Positive5-.263
-30Positive6-30
-31.429Positive7-31.429
-36.842Positive8-36.842
-40Positive9-40
-50Positive10-50
150Negative11150
142.857Negative12142.857
78.152Negative1378.152
58.065Negative1458.065
52.174Negative1552.174
-3.704Negative16-3.704
-4Negative17-4
-4.762Negative18-4.762
-7.143Negative19-7.143
-18.75Negative20-18.75

Accepted Solutions
Solution
‎10-11-2011 10:23 AM
SAS Employee
Posts: 967

Use Multiple Colors in a Graph

Here's an example where I've used Proc Gchart and Annotate to create a waterfall chart - I think you can re-use this technique to get the graph you're wanting...

http://robslink.com/SAS/democd41/waterfall_anno.htm

http://robslink.com/SAS/democd41/waterfall_anno_info.htm

View solution in original post


All Replies
Solution
‎10-11-2011 10:23 AM
SAS Employee
Posts: 967

Use Multiple Colors in a Graph

Here's an example where I've used Proc Gchart and Annotate to create a waterfall chart - I think you can re-use this technique to get the graph you're wanting...

http://robslink.com/SAS/democd41/waterfall_anno.htm

http://robslink.com/SAS/democd41/waterfall_anno_info.htm

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 151 views
  • 0 likes
  • 2 in conversation