Dear All,
I am trying to make a policy map using maptile and am having some issues with creating the correct legend. Here is my data:
[CODE]
Here is my maptile code:
Graph.gph
3 things are not correct in the legend:
(1) The order of the legend is reversed i.e. Excluded, October, July, June, May and April instead of April, May, June, July, October and Excluded.
(2) April 1, 2023, label value is missing even though it's specified in legend (lab) option
(3) 2 additional legend values 5-6 and 6-6 have been added.
I am not sure what I am doing wrong and have played around quite a bit with the legend option but cannot figure this out. Would be very grateful for any help I can get.
Many thanks in advance for your help. Gratefully,
Sumedha
I am trying to make a policy map using maptile and am having some issues with creating the correct legend. Here is my data:
[CODE]
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte statefips str15 pol1 float pol2 2 "June 1, 2023" 3 1 "June 1, 2023" 3 5 "April 1, 2023" 1 4 "April 1, 2023" 1 6 "July 1, 2023" 4 8 "June 1, 2023" 3 9 "May 1, 2023" 2 11 "June 1, 2023" 3 10 "July 1, 2023" 4 12 "May 1, 2023" 2 13 "June 1, 2023" 3 15 "June 1, 2023" 3 19 "May 1, 2023" 2 16 "April 1, 2023" 1 17 "July 1, 2023" 4 18 "May 1, 2023" 2 20 "May 1, 2023" 2 21 "June 1, 2023" 3 22 "July 1, 2023" 4 25 "June 1, 2023" 3 24 "June 1, 2023" 3 23 "June 1, 2023" 3 26 "July 1, 2023" 4 27 "July 1, 2023" 4 29 "Excluded" 6 28 "June 1, 2023" 3 30 "June 1, 2023" 3 37 "July 1, 2023" 4 38 "June 1, 2023" 3 31 "Excluded" 6 33 "April 1, 2023" 1 34 "June 1, 2023" 3 35 "May 1, 2023" 2 32 "June 1, 2023" 3 36 "July 1, 2023" 4 39 "May 1, 2023" 2 40 "Excluded" 6 41 "October 1, 2023" 5 42 "May 1, 2023" 2 44 "June 1, 2023" 3 45 "June 1, 2023" 3 46 "Excluded" 6 47 "June 1, 2023" 3 48 "June 1, 2023" 3 49 "May 1, 2023" 2 51 "May 1, 2023" 2 50 "June 1, 2023" 3 53 "June 1, 2023" 3 55 "June 1, 2023" 3 54 "May 1, 2023" 2 56 "May 1, 2023" 2 end
Code:
. maptile pol2, geo(state) geoid(statefips) fcolor(navy midblue ebblue emerald eltgreen gray) twopt(legend(lab( 1 "April 1, 2 > 023") lab(2 "May 1, 2023") lab(3 "June 1, 2023") lab(4 "July 1, 2023") lab(5 "October 1, 2023") lab(6 "Excluded")) legend(c > ol(1) )) cutp(pol2)
3 things are not correct in the legend:
(1) The order of the legend is reversed i.e. Excluded, October, July, June, May and April instead of April, May, June, July, October and Excluded.
(2) April 1, 2023, label value is missing even though it's specified in legend (lab) option
(3) 2 additional legend values 5-6 and 6-6 have been added.
I am not sure what I am doing wrong and have played around quite a bit with the legend option but cannot figure this out. Would be very grateful for any help I can get.
Many thanks in advance for your help. Gratefully,
Sumedha
Comment