BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10

Hello,

 

I would like to generate a graph by using proc sgplot. It works but the lines are all black. I would like to attibute differents colors for each group value. I don't know where (and how) I should specify colors

my code is

ODS RTF startpage = yes FILE = "&filename." style = journal ;

proc sgplot data = BEH_SUITE_INDIC ;

xaxis type=discrete;

series x = ANNEE_AMO_SUITE y = ratio / group = DUREE ;

xaxis display=(nolabel);

yaxis display=(nolabel);

run;

ODS RTF CLOSE ;

 

thanks a lot in advance for your help

1 ACCEPTED SOLUTION

Accepted Solutions
Nasser_DRMCP
Lapis Lazuli | Level 10

I works ! thanks warren ! have a goodday !

View solution in original post

7 REPLIES 7
RW9
Diamond | Level 26 RW9
Diamond | Level 26

First stop on any graph question is this blog:

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

 

It has code examples for any kind of graph you can think of with code examples. A quick search there shows hundreds of examples:

http://blogs.sas.com/content/?s=sgplot+color

WarrenKuhfeld
Rhodochrosite | Level 12

@RW9 provided good advice.  Additionallly, replace journal (a black and white style) with something like Sapphire (a color style suitable for RTF).  Also, check out the styles comparison section of this sas/stat chapter on ods graphics.

 

https://support.sas.com/documentation/onlinedoc/stat/132/odsgraph.pdf

Nasser_DRMCP
Lapis Lazuli | Level 10

hI Warren

thanks for your respons. I put sapphire. Now my group lines are all blue. What I would like is to get one different color per group.

thanks

WarrenKuhfeld
Rhodochrosite | Level 12

Group colors are definitely not all blue.

 

ods rtf style=sapphire image_dpi=300;
proc sgplot data=sashelp.iris;
reg y=petalwidth x=petallength / group=species;
run;
ods rtf close;

I would have to see something reproducible.


iris.png
Nasser_DRMCP
Lapis Lazuli | Level 10

I works ! thanks warren ! have a goodday !

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Please stop marking your own responses as the correct answer.  If @WarrenKuhfeld 's information helped you, mark his answer as the correct one so that it appears at the top of the page, i.e. question/answer.

Nasser_DRMCP
Lapis Lazuli | Level 10

ok sorry !

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 7 replies
  • 4015 views
  • 4 likes
  • 3 in conversation