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

Hi,

 

I made a scatter plot using below code.

 

proc sort data=cp_new;
by Titer;
run;

 

PROC sgscatter DATA=CP_new;
PLOT Titer * IMC_Titer_RBD_1
/datalabel = Titer group = Titer;
RUN;

Titer.png

 

How do I:

1. Fill in the colors into the circles?

2. Make the fonts bigger?

3. Change the these pastel colors to brighter colors? The grient colors are great ideas too because these are 0, 160, 200, 400, 600, 800... levels.

4. Export the picture with higher resolution for publication purpose, e.g. 300 dpi?

 

Thank you very much in advance! 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Here is an example to get you on the way

 

ods listing gpath="/home/pg/SASforum/Graphs";
ods graphics imagename="Iris example" image_dpi=300 width=12cm height=9cm;

proc sgplot data=sashelp.iris noautolegend;
format species $3.; /* Keep only 3 letters of species names as labels */
styleattrs datasymbols=(circlefilled) datacontrastcolors=(vividred vividblue palegreen);
scatter y=petalLength x=sepalLength / 
    jitter datalabel=species group=species datalabelattrs=(size=6);
xaxis offsetmin=0.05 offsetmax=0.05; /* Add extra space around the data area */
yaxis offsetmin=0.05 offsetmax=0.05;
run;

image.png

 

PG

View solution in original post

2 REPLIES 2
Reeza
Super User
I would use SGPLOT instead. Then look at the STYLEATTRS line to customize your graphs. Attribute maps are a good way to control the colours for each point and grouping.

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=grstatproc&docsetTarget=p...

Discrete attribute maps
https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=grstatproc&docsetTarget=n...

PGStats
Opal | Level 21

Here is an example to get you on the way

 

ods listing gpath="/home/pg/SASforum/Graphs";
ods graphics imagename="Iris example" image_dpi=300 width=12cm height=9cm;

proc sgplot data=sashelp.iris noautolegend;
format species $3.; /* Keep only 3 letters of species names as labels */
styleattrs datasymbols=(circlefilled) datacontrastcolors=(vividred vividblue palegreen);
scatter y=petalLength x=sepalLength / 
    jitter datalabel=species group=species datalabelattrs=(size=6);
xaxis offsetmin=0.05 offsetmax=0.05; /* Add extra space around the data area */
yaxis offsetmin=0.05 offsetmax=0.05;
run;

image.png

 

PG

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 979 views
  • 2 likes
  • 3 in conversation