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

 

Code trying to run, does not pickup the rangealtcolormodel colors.


proc template;
define statgraph ap01t;
begingraph / drawspace=datavalue;
* entrytitle "";
rangeattrmap name="densityrange" ;
range MISSING / rangealtcolor=gray ;
range MIN - MAX / rangealtcolormodel=(red orange yellow) ;
endrangeattrmap ;
rangeattrvar attrvar=rangevar var=ACT_CUST_OUT attrmap="densityrange";
layout overlayequated / equatetype=equate border=false
xaxisopts=(label=" " display=none)
yaxisopts=(label=" " display=none)
;
polygonplot x=X y=Y id=Shape / display=(fill)
COLORRESPONSE=rangevar
name="Shape"
;
polygonplot x=X y=Y id=Shape / display=(outline) OUTLINEATTRS=(color=black) group=Otln;
continuouslegend "Shape" / orient=vertical
location=outside valign=center halign=right
valuecounthint=10 title="Shape";
endlayout;
* entryfootnote halign=left "";
endgraph;
end;
run;


proc sgrender data=Shape template=ap01t;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Since these are filled areas, use RANGECOLOR and RANGECOLORMODEL instead of use RANGEALTCOLOR and RANGEALTCOLORMODEL.

View solution in original post

4 REPLIES 4
Jay54
Meteorite | Level 14

The answer is "Yes".  Please attach full code with data to debug your case.

Bryan
Obsidian | Level 7

Had to generate some data since my data set has over 100,000 rows but this generated data set gives me the same result.

 

 

data Shape;
;
infile datalines delimiter='09'x dsd firstobs=1;
input Obs Otln id x y vrRng;
datalines;
1 1 1 0 0 10
2 1 1 20 0 10
3 1 1 20 30 10
4 1 1 0 30 10
5 1 1 0 0 10
6 1 2 30 0 5
7 1 2 50 0 5
8 1 2 40 30 5
9 1 2 30 0 5
10 1 3 60 0 15
11 1 3 80 5 15
12 1 3 80 15 15
13 1 3 70 30 15
14 1 3 60 30 15
15 1 3 60 0 15
16 1 4 30 40 25
17 1 4 50 40 25
18 1 4 40 70 25
19 1 4 30 40 25
20 1 5 0 50 10
21 1 5 20 50 10
22 1 5 20 80 10
23 1 5 0 80 10
24 1 5 0 50 10
25 1 3 60 50 .
26 1 3 80 55 .
27 1 3 80 65 .
28 1 3 70 80 .
29 1 3 60 80 .
30 1 3 60 50 .
;
Run;


proc template;
define statgraph Map01t;
begingraph / drawspace=datavalue;
* entrytitle "";
rangeattrmap name="densityrange" ;
range MISSING / rangealtcolor=gray ;
range MIN - MAX / rangealtcolormodel=(red orange yellow) ;
endrangeattrmap ;
rangeattrvar attrvar=rangevar var=vrRng attrmap="densityrange";
layout overlayequated / equatetype=equate border=false
xaxisopts=(label=" " display=none)
yaxisopts=(label=" " display=none)
;
polygonplot x=X y=Y id=id / display=(fill)
COLORRESPONSE=rangevar
name="Shape"
;
polygonplot x=X y=Y id=id / display=(outline) OUTLINEATTRS=(color=black) group=Otln;
continuouslegend "Shape" / orient=vertical
location=outside valign=center halign=right
valuecounthint=10 title="Shape";
endlayout;
* entryfootnote halign=left "";
endgraph;
end;
run;
proc sgrender data=Shape template=Map01t;
run;

 

 

 
DanH_sas
SAS Super FREQ

Since these are filled areas, use RANGECOLOR and RANGECOLORMODEL instead of use RANGEALTCOLOR and RANGEALTCOLORMODEL.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2127 views
  • 3 likes
  • 3 in conversation