Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display Mexican state names usin spmap

    Hello everyone,

    I'm using spmap from SSC in Stata 13.1. I am currently working on Mexico. My goal is to display the Gini index for every 2457 Mexican municipalities while outlining the Mexican states. I obtained it using the command:

    Code:
    spmap giniE using mexico1_xy, id(id) fcolor(Oranges) ocolor(none ..) title("Education Inequality in Mexico by Municipalities""in 2015") ndlab("Missing")
    ndfcolor(gs7) legend(position(1) region(lcolor(purple) fcolor(white)) title("Gini Index", size(*0.4))) polygon(data(mexico_state_xy) osize(*0.85))
    Now I want to display on this map the name of the 32 Mexican states which are in the "mexico_state_xy" file. I was able to display the municipalities' name with the command:

    Code:
    spmap giniE using mexico1_xy, id(id) label(xcoord(x_c) ycoord(y_c) label(DES_MUN)) fcolor(Oranges) ocolor(none ..) title("Education Inequality in Mexico by Municipalities""in 2015") ndlab("Missing") ndfcolor(gs7) legend(position(1) region(lcolor(purple) fcolor(white)) title("Gini Index", size(*0.4))) polygon(data(mexico_state_xy) osize(*0.85))
    but unfortunatly I can't find how to display the state names. What is the right command to do so ?

    Thanks a lot
    Click image for larger version

Name:	Jolie Carte.png
Views:	1
Size:	88.3 KB
ID:	1468669

    Last edited by Lucie Piaser; 02 Nov 2018, 09:02.

  • #2
    I finally found my answer:
    Code:
    spmap gini using mexico1_xy, id(id) label(data(mexico_state) xcoord(x_c) ycoord(y_c) label(NOM_ENT) length(30) size(vsmall)) fcolor(Oranges) ocolor(none ..) ///
    ndlab("Missing") ndfcolor(gs7) ndocolor(none ..) legend(position(1) region(lcolor(black) fcolor(white)) title("Income Gini", size(*0.4))) /// 
    polygon(data(mexico_state_xy) osize(*0.85))

    Comment


    • #3
      Hi Lucie,
      I am trying to use Stata to map Mexican municipalities, where did you get the mexico1_xy and corresponding x_c and y_c files ? I downloaded a shapefile from https://datacatalog.worldbank.org/da...ipalities-2012, but they don't have those files. Thanks !

      Comment

      Working...
      X