Data visualization with SAS programming

SGPLOT colors

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

SGPLOT colors

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


Accepted Solutions
Solution
4 weeks ago
Contributor
Posts: 28

Re: SGPLOT colors

I works ! thanks warren ! have a goodday !

View solution in original post


All Replies
Super User
Super User
Posts: 7,392

Re: SGPLOT colors

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

SAS Employee
Posts: 115

Re: SGPLOT colors

@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

Contributor
Posts: 28

Re: SGPLOT colors

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

SAS Employee
Posts: 115

Re: SGPLOT colors

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
Solution
4 weeks ago
Contributor
Posts: 28

Re: SGPLOT colors

I works ! thanks warren ! have a goodday !

Super User
Super User
Posts: 7,392

Re: SGPLOT colors

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.

Contributor
Posts: 28

Re: SGPLOT colors

ok sorry !

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 338 views
  • 4 likes
  • 3 in conversation