Announcement

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

  • Drawing a map of a region using spmap command showing number of centers per delegation

    Hello Stata people;

    I have this data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int ID float(x_centroid y_centroid) str21 delegation float nombre_centres
    103 645740.1   4054447 "BENI KHALLED"    1
     86 658415.8   4043640 "BENI KHIAR"      1
    101 641337.9 4043444.5 "BOU ARGOUB"      1
     87 652314.5   4042953 "DAR CHAABANE"    0
     89 670731.5   4091291 "EL HAOUARIA"     2
     83 665135.9   4065032 "EL MIDA"         2
    102 629273.3 4049610.5 "GROMBALIA"       1
     81 684200.4   4088900 "HAMMAM GHEZAZE"  1
    100 633880.6   4032543 "HAMMAMET"        0
     82 680216.3   4082860 "KELIBIA"         1
     85 661669.3   4053786 "KORBA"           2
    104 649132.5   4062233 "MENZEL BOUZELFA" 2
     84 670452.8   4074543 "MENZEL TEMIME"   3
     88 650455.3   4037900 "NABEUL"          0
     79 636384.9   4065126 "SOLIMAN"         1
     80 650102.3   4074666 "TAKELSA"         0
    end
    As you can see, it is mapping stuff. What I wanna do is draw the map of the region that shows, for each delegation, the number of centers in it, using points or little circles or something like that, it would be helpful if it could be appealing even on the visual settings aswell (colors, the shape and the size of the points, delegations colors, ...)

    Could I get any help please?

    Thanks!

  • #2
    Will this be helpful?
    Code:
    spmap using "XXXXXX.dta"(your Coordinates.dta), id(ID) label(label(nombre_centres) xcoord(x_centroid) ycoord(y_centroid))

    Comment


    • #3
      Chen Samulsion Thanks for the help It kinda worked, yet, my goal is to have the numbers of centers of each delegation represented by points inside that same delegation, like points of small circles refering to the number of center (For instance, if a delegation has got 2 centers, then I wanna have 2 circles on that delegation)
      Last edited by Aziz Essouaied; 27 Mar 2023, 02:14.

      Comment


      • #4
        It seems that spmap only allows one point/label for one id. Maybe you can ask Maurizio Pisati or Robert Picard who are experts on drawing map in Stata.

        Comment


        • #5
          Maurizio Pisati Robert Picard Chen Samulsion Hello to you all;

          I've done some reaserch on this, and I guess there is an option on the spmap package called "point()", I just don't know how to use that in the code since I don't know that option.
          Also, there's another mapping package called "grmap", but, when trying to install it, it just doesn't.
          ​​​​​​​As a first guess, I think point() would help

          Comment

          Working...
          X