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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 1415 views
  • 2 likes
  • 2 in conversation