'Stata spmap legend key symbol and legend text off not aligned
I am creating a filled geographical map. I think I have what I want, but for some unexplained reasons, the legend key and the legend text are not in the same line. Would anyone know what is the issue? I have put a blue line at the bottom of the legend to show that the legend text and key symbols are not aligned. See here in this map
Additionally, I found it very odd that I had to start the labelling from "2" instead of "1". What could be the reason for that?
This is the code used to generate the map:
spmap predictions using "$shape/district polygons.dta", ///
id(id) ///
title("TEST predictions") ///
label(data("district predictions.dta") ///
xcoord(x_coord) ycoord(y_coord) label(DISTRICT) ///
pos(0) size(*0.9)) ///
clmethod(custom) ///
clbreaks(0 (5000) 30000) ///
fcolor($colorscale_stata) ///
legorder(lohi) ///
legend(pos(11) col(1) rowgap(0.3) size(*1.6) margin(l = 0.6 b = -0.2) ///
symysize(*0.9) alignment(top) ///
label(2 "0 to 5000") ///
label(3 "5000 to 10000") ///
label(4 "10000 to 15000") ///
label(5 "15000 to 20000") ///
label(6 "20000 to 25000") ///
label(7 "25000+") ///
title("PREDICTIONS", pos(11) size(4)))
Solution 1:[1]
Possibly because label 1 is intended for missing data
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Carlos Mangunsong |