BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
juanvg1972
Pyrite | Level 9

Hi,

 

I am using sgscatter:

 

PROC SGSCATTER DATA=test;
TITLE "Matriz del trazado de dispersión";
MATRIX compras_3m compras_12m tipo_cliente1 rango_edad
/ GROUP=res_campa ;
RUN;

 

I get some graph x-y combining compras_3m compras_12m tipo_cliente1 rango_edad and the color and symbol of the dot

is res_campa. The var res_campa is my target var in the model. It has 2 possible values 1 and 0.

I want to change the color and the symbol of res_campa values in my graph of sgscatter, how can I do it??

The default color are very similar and the graph is using by defalut the same symbol (o) for both values.

 

I want ti change color and symbol of dots depending on res_campa values.

 

If the solution is using sgplot or similar I don't mind to use another proc...

 

Any advice will be greatfull appreciatted.

 

Thanks in advance.

 

Juan

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

First port of call on any graph related question:

http://blogs.sas.com/content/graphicallyspeaking/

 

There is examples for virtually every graph imaginable in sgplot/gtl etc.

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

First port of call on any graph related question:

http://blogs.sas.com/content/graphicallyspeaking/

 

There is examples for virtually every graph imaginable in sgplot/gtl etc.

juanvg1972
Pyrite | Level 9

Thanks, this is my solution:

 

data Attrs;
length Value 8. MarkerColor $20 Markersymbol $20;
ID = "res_campa";
Value = 0; MarkerColor = "DarkBlue "; Markersymbol = "circlefilled "; output;
Value = 1; MarkerColor = "DarkRed "; Markersymbol = "star ";output;
run;

 

PROC SGSCATTER DATA=test DATTRMAP=Attrs;
TITLE "Matriz del trazado de dispersión";
MATRIX compras_3m compras_12m tipo_cliente1 rango_edad
/
GROUP=res_campa ATTRID=res_campa ;

RUN;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1992 views
  • 2 likes
  • 2 in conversation