Data visualization with SAS programming

Color code the data points in proc gplot

Reply
Contributor sfo
Contributor
Posts: 66

Color code the data points in proc gplot

Hi,

 

Is there a way I can color code the Y-axis data points used in proc gplot for example:

 

ID YData XData

101 10 10

101 20 20

101 30 30

102 10 40

102 20 50

102 30 60

 

I am using proc gplot YData * XData = ID and would like to color code each YData i.e. value 10 gets color blue, value 20 gets color red, value 30 gets color orange.

 

Also, all the data points for each ID should be connected using a black line.

SAS Super FREQ
Posts: 925

Re: Color code the data points in proc gplot

What version of SAS are you using?

Contributor sfo
Contributor
Posts: 66

Re: Color code the data points in proc gplot

I am using 9.2 and prefer to use Proc Gplot

 

Thanks

SAS Super FREQ
Posts: 925

Re: Color code the data points in proc gplot

See if this will work for you:

 

data test;
input ID YData XData;
cards;
101 10 10
101 20 20
101 30 30
102 10 40
102 20 50
102 30 60
;
run;

symbol1 i=join c=black v=none;
symbol2 i=join c=black v=none;
symbol3 i=none v=dot c=blue;
symbol4 i=none v=dot c=red;
symbol5 i=none v=dot c=orange;
proc gplot data=test;
plot ydata*xdata=id;
plot2 ydata*xdata=ydata;
run;
Contributor sfo
Contributor
Posts: 66

Re: Color code the data points in proc gplot

Thanks for the solution. It worked.

Ask a Question
Discussion stats
  • 4 replies
  • 321 views
  • 1 like
  • 2 in conversation