Data visualization with SAS programming

Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

 

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;


Accepted Solutions
Solution
‎03-31-2016 03:46 PM
SAS Super FREQ
Posts: 864

Re: Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

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

View solution in original post


All Replies
SAS Super FREQ
Posts: 1,044

Re: Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

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

Contributor
Posts: 28

Re: Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

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;

 

 

 
Solution
‎03-31-2016 03:46 PM
SAS Super FREQ
Posts: 864

Re: Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

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

Contributor
Posts: 28

Re: Can you use rangealtcolormodel with proc template in the polygonplot statement, code below?

Thanks that worked.

Post a Question
Discussion Stats
  • 4 replies
  • 331 views
  • 3 likes
  • 3 in conversation