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

Hi there.

I am defining a template for the lattice layout of my heatmaps with the polygonplot statement. I am 95% satisfied with the output. However, the cell border is the problem I cannot resolve. I simply want to remove the cell borders. I used "border=false" in each cell. I also tried to use "borderattrs=(color=white) backgroundcolor=white" to blend the border into background. But neither works. Below is the program I used.

 

proc template;
define statgraph polygons_all;
begingraph /designwidth=2000px border=false;

entrytitle textattrs=(size=12pt color=black weight=bold) 'Need Gaps';

entryfootnote textattrs=(size=12pt color=black)
"Need gap = Differences between the demand and supply in ZCTAs";

legenditem type=marker name="R" / label="Not rural areas"
lineattrs=(color=gray)
markerattrs=(symbol=squarefilled color=gray size=10pt);
legenditem type=marker name="U" / label="Not urban areas"
lineattrs=(color=gray)
markerattrs=(symbol=squarefilled color=lightgray size=10pt);

discreteattrmap name="b_R" / ignorecase=true;
value "Need gap, [0.31, 1.57]"/
fillattrs=GraphData1(color=A581A22FF);
value "Need gap, [0.12, 0.31)"/
fillattrs=GraphData2(color=A985159FF);
value "Need gap, [0.05, 0.12)"/
fillattrs=GraphData3(color=AB27C83FF);
value "Need gap, [0, 0.05)"/
fillattrs=GraphData4(color=AD8BEC1FF);
value "Need gap, (-0.47, 0)"/
fillattrs=GraphData5(color=A80CDC433);
value "Need gap, (-0.99, -0.47]"/
fillattrs=GraphData6(color=A26A69A33);
value "Need gap, (-2.71, -0.99]"/
fillattrs=GraphData7(color=A00897B33);
value "Need gap, [-8.88, -2.71]"/
fillattrs=GraphData8(color=A004D4033);
value "Not rural areas"/
fillattrs=GraphData9(color=Gray);
value "Missing"/
fillattrs=GraphData10(color=WHITE);
enddiscreteattrmap;
discreteattrvar attrvar=lvlR var=lvlR attrmap="b_R";

discreteattrmap name="b_U" / ignorecase=true;
value "Need gap, [0.31, 1.57]"/
fillattrs=GraphData1(color=A581A22FF);
value "Need gap, [0.12, 0.31)"/
fillattrs=GraphData2(color=A985159FF);
value "Need gap, [0.05, 0.12)"/
fillattrs=GraphData3(color=AB27C83FF);
value "Need gap, [0, 0.05)"/
fillattrs=GraphData4(color=AD8BEC1FF);
value "Need gap, (-0.47, 0)"/
fillattrs=GraphData5(color=A80CDC433);
value "Need gap, (-0.99, -0.47]"/
fillattrs=GraphData6(color=A26A69A33);
value "Need gap, (-2.71, -0.99]"/
fillattrs=GraphData7(color=A00897B33);
value "Need gap, [-8.88, -2.71]"/
fillattrs=GraphData8(color=A004D4033);
value "Not urban areas"/
fillattrs=GraphData11(color=lightGray);
value "Missing"/
fillattrs=GraphData10(color=WHITE);
enddiscreteattrmap;
discreteattrvar attrvar=lvlU var=lvlU attrmap="b_U";

discreteattrmap name="b_all" / ignorecase=true;
value "Need gap, [0.31, 1.57]"/
fillattrs=GraphData1(color=A581A22FF);
value "Need gap, [0.12, 0.31)"/
fillattrs=GraphData2(color=A985159FF);
value "Need gap, [0.05, 0.12)"/
fillattrs=GraphData3(color=AB27C83FF);
value "Need gap, [0, 0.05)"/
fillattrs=GraphData4(color=AD8BEC1FF);
value "Need gap, (-0.47, 0)"/
fillattrs=GraphData5(color=A80CDC433);
value "Need gap, (-0.99, -0.47]"/
fillattrs=GraphData6(color=A26A69A33);
value "Need gap, (-2.71, -0.99]"/
fillattrs=GraphData7(color=A00897B33);
value "Need gap, [-8.88, -2.71]"/
fillattrs=GraphData8(color=A004D4033);
value "Missing"/
fillattrs=GraphData10(color=WHITE);
enddiscreteattrmap;
discreteattrvar attrvar=lvlA var=lvlA attrmap="b_all";

layout lattice/columns=4 rows=1 COLUMNWEIGHTS=(.28 .28 .28 .16)
border=false backgroundcolor=white opaque=true;


cell;
cellheader;
entry "Rural areas"/textattrs=(size=12pt color=black);
endcellheader;

layout overlay/xaxisopts=(display=none) yaxisopts=(display=none)
border=false backgroundcolor=white opaque=true;

polygonplot X=x Y=y ID=ID/
group=lvlR display=(fill outline) dataskin=pressed
name="g_R"
OUTLINEATTRS=(color=white);
endlayout;
endcell;

/* The second cell for the map of "Urban areas". */
cell;
cellheader;
entry "Urban areas"/textattrs=(size=12pt color=black);
endcellheader;
layout overlay/xaxisopts=(display=none) yaxisopts=(display=none)
border=false borderattrs=(color=white) backgroundcolor=white opaque=true;
polygonplot X=x Y=y ID=ID/
group=lvlU display=(fill outline) dataskin=pressed
name="g_U"
OUTLINEATTRS=(color=white)
;
endlayout;
endcell;


cell;
cellheader;
entry "All areas"/textattrs=(size=12pt color=black);
endcellheader;
layout overlay/xaxisopts=(display=none) yaxisopts=(display=none)
border=false backgroundcolor=white opaque=true;
polygonplot X=x Y=y ID=ID/
group=lvlA display=(fill outline) dataskin=pressed
name="g_all"
OUTLINEATTRS=(color=white);
endlayout;
endcell;


discretelegend "g_all" "R" "U"/ LOCATION=outside halign=right
border=false

title="Gap categories" titleattrs=(color=black size=12pt)
across = 1 valueattrs=(color=black size=12pt)
autoitemsize=true;

endlayout;
endgraph;
end;
run;

 

proc sgrender data=gap1_map template=polygons_all;
format lvlR flvlR. lvlU flvlU. lvlA flvlA. ;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
JeffMeyers
Barite | Level 11

If you are talking about the borders around each cell in the lattice then you are probably looking to turn off the WALL, not the border.  In the layout overlay options specify WALLDISPLAY=none (or off?).  The wall is normally drawn around each overlay layout space and covers the x/y/x2/y2 axes.

View solution in original post

7 REPLIES 7
Athenkosi
Obsidian | Level 7

Hello,

 

May you please send me a screenshot of your output so I can see the issue that you are having.

adcc5465
Fluorite | Level 6

example.png

Thanks for your reply.

Here is the final output.

JeffMeyers
Barite | Level 11

If you are talking about the borders around each cell in the lattice then you are probably looking to turn off the WALL, not the border.  In the layout overlay options specify WALLDISPLAY=none (or off?).  The wall is normally drawn around each overlay layout space and covers the x/y/x2/y2 axes.

adcc5465
Fluorite | Level 6

Thank you so much.

That solves the problem!

t75wez1
Pyrite | Level 9

For other people to learn, could you share your SAS data set named "gap1_map"?

 

Thanks,

Ethan

adcc5465
Fluorite | Level 6
I am sorry. But I am not allowed to share the data.
t75wez1
Pyrite | Level 9

What about a small sample of masked data set?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1269 views
  • 5 likes
  • 4 in conversation