Data visualization with SAS programming

SAS Graph Color Codes

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 126
Accepted Solution

SAS Graph Color Codes

I'm trying to color three areas on a map with different shades of orange but the colors seem to be different shades of brown, doesn't matter if I use the color name (for example BIO for brilliant orange) or the Hex code CXD9892B, it looks like light brown to me.

Thanks,

Brian


Accepted Solutions
Solution
‎01-27-2014 12:26 PM
SAS Employee
Posts: 967

Re: SAS Graph Color Codes

Hmm ... looking at the code, looks like it will use the colors from the first 10 pattern statements.

You might want to add "goptions reset=pattern;" just before the pattern statements.

Also, if you change a few of the colors to ones like yellow, green, red, do they show up in the map?

View solution in original post


All Replies
SAS Employee
Posts: 967

Re: SAS Graph Color Codes

Are you using Proc Gmap, and pattern statements? (or are you relying on a Goptions color list, or ODS Styles to control the colors?)

If you change the colors in your pattern statements to other colors (other than shades of orange), does that work (such as yellow, pink, green)? If this does not work, then perhaps there's somehting about your code (possibly the order of statements, etc?) or maybe something about the way you're running it (maybe in a Stored Process, or from EG?) that migth be affecting things.

More details, and an example of the code you're using, will help us help you better! Smiley Happy

Frequent Contributor
Posts: 126

Re: SAS Graph Color Codes

Robert,

Thanks again for responding. The code I'm using is pasted below (P.S. What is the best way to copy/paste code in here?. Do I have toggle HTML mode?)


goptions reset=all;

/*goptions colors=(CXFF0000 CX00FF00 CX0000FF);*/

ods graphics on / reset=all;

ODS HTML style=Default;

pattern1 v=s c=cxFFFFFF; pattern2 v=s c=cx0000FF; pattern3 v=s c=CXD9892B; pattern4 v=s c=cxFF6600; pattern5 v=s c=cx0000FF; pattern6 v=s c=cx0000FF; pattern7 v=s c=cx008000; pattern8 v=s c=cx008000; pattern9 v=s c=cx9999FF; pattern10 v=s c=cxFF9900; pattern11 v=s c=cx800080; pattern12 v=s c=cx993300; pattern13 v=s c=cxffdd00; pattern14 v=s c=cxffdc00; pattern15 v=s c=cxffd800; pattern16 v=s c=cxffd100; pattern17 v=s c=cxffcd00; pattern18 v=s c=cxffc000; pattern19 v=s c=cxffb700; pattern20 v=s c=cxff9a00; pattern21 v=s c=cxff8700; pattern22 v=s c=cxff7700; pattern23 v=s c=cxff5400; pattern24 v=s c=cxff3400; pattern25 v=s c=cxff0000;

proc gmap data=gazetteer5 map=vazip3 anno=anno_county2;

    id zcta; /* matches values between response and map dataset */

    choro VaComm /* response variable */ / levels=10 /* pattern/color levels */

    nolegend coutline=same  /*turn off boundary lines*/;

run;quit;

ODS HTML close;

ods graphics off;

Solution
‎01-27-2014 12:26 PM
SAS Employee
Posts: 967

Re: SAS Graph Color Codes

Hmm ... looking at the code, looks like it will use the colors from the first 10 pattern statements.

You might want to add "goptions reset=pattern;" just before the pattern statements.

Also, if you change a few of the colors to ones like yellow, green, red, do they show up in the map?

Frequent Contributor
Posts: 126

Re: SAS Graph Color Codes

Robert,

Yes, I have 9 communities that I'm color-coding and all the rest are white (pattern1). I just tried using some of the color codes from ColorBrewer and it seems to be working as I want it to.

Thanks again for your help!

Brian

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 516 views
  • 3 likes
  • 2 in conversation