Announcement

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

  • #16
    Daniel Shin Thanks for the help I do guess the first grapg is more helpful for my situation than the second (the one with the blue degradation), I do tthink the second one could be used with an indicator like poverty or economic development for delegations. Yet, I was thinking to do like 16 different colors chosen in a random way, just to make each delegation stand out and make it kinda clear to spot on the map. After all, I guess I'm gonna use a map without coloring for this one, just since distinct coloring option isn't available.
    Anyway, I do appreciate the help Thanks

    Comment


    • #17
      I would try the Rainbow color option for example 2.

      Comment


      • #18
        Hello Daniel Shin and Stata users;

        If I may get back on the subject of this discussion asking for some help and some clearing.

        So, I did create the map, but for this I'm gonna use the black and white map with the names of the delegations using this code:
        shp2dta using "D‚l‚gation Nabeul", database(ddb) coordinates(dcoord) genid(ID) gencentroids(centroid) replace use ddb, clear spmap using dcoord, id(ID) name(del) replace alt_name_f=alt_name_f[_n+16] if _n<=16 // KEY spmap using dcoord, id(ID) name(del_label) label(x(x_centroid) y(y_centroid) l(alt_name_f)) Now, I do have this data: [CODE] * Example generated by -dataex-. To install: ssc install dataex clear input str15 delegation int(forage greenfodder) "NABEUL" 320 114 "KORBA" 790 310 "EL MIDA" 555 408 "MENZEL TEMIME" 1350 1670 "KELIBIA" 1050 660 "HAMMAM GHEZAZE" 275 522 "EL HAOUARIA" 2620 2250 "TAKELSA" 1070 160 "SOLIMAN" 280 80 "BENI KHALLED" 150 67 "MENZEL BOUZELFA" 1000 458 "GROMBALIA" 550 206 "BOU ARGOUB" 500 75 "HAMMAMET" 820 330 end It shows for each delegation the surfaces of two types of agriculture: forage and greenfodder My goal is to have the map of the governorate of Nabeul that shows the concentration of each type of agriculture for each of the 16 delegations, like a color degradation map. I'm still wondering about the number of levels I should have, I don't know if there's a rule to follow there tho. Also, since both of the agricultures are of different types, I do think I should have a map for each type. Any help please? ​​​​​​​ Thanks!

        Comment


        • #19
          shp2dta using "Délégation_Nabeul", database(ddb) coordinates(dcoord) genid(ID) gencentroids(centroid) replace
          use ddb, clear
          spmap using dcoord, id(ID) name(del)
          replace alt_name_f=alt_name_f[_n+16] if _n<=16
          spmap using dcoord, id(ID) name(del_label) label(x(x_centroid) y(y_centroid) l(alt_name_f))

          Here's the code for the map again.

          Should I start by creating the map or uploading the data as a first step already?

          Comment


          • #20
            Assuming your data is saved as "newdata.dta" and using quantiles for the cutoffs (you can specify your own, please see help spmap for options

            Code:
            clear all
            
            * Delegation
            shp2dta using "D‚l‚gation Nabeul", database(ddb) coordinates(dcoord) genid(ID) gencentroids(centroid) replace
            use ddb, clear
            replace alt_name_f=alt_name_f[_n+16] if _n<=16
            replace ref_tn_cod=ref_tn_cod[_n+16] if _n<=16
            replace code_gouve=code_gouve[_n+16] if _n<=16
            replace Nom_gouver=Nom_gouver[_n+16] if _n<=16
            drop if _n>16
            * IMPORT FORAGE/GREENFODDER DATA  
            ren alt_name_f delegation
            merge 1:1 delegation using newdata
            
            * FORAGE
            spmap forage using dcoord, name(del_col1) id(ID) fcolor(Greens) clmethod(quantile) label(x(x_centroid) y(y_centroid) l(delegation))
            
            * GREEN FODDER
            spmap greenfodder using dcoord, name(del_col2) id(ID) fcolor(Greens) clmethod(quantile) label(x(x_centroid) y(y_centroid) l(delegation))
            
            graph combine del_col1 del_col2

            Comment

            Working...
            X