Announcement

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

  • Dashed Border on Spmap Stata

    Hi All,

    I have to create a map in which I would like to have solid state borders and dash counties borders. I tried the following:

    spmap using counties_coordinates.dta, id(id) mopattern(dash) polygon(data(states_coordinates.dta) osize(0.2) ocolor(black))

    but it doesn't work....

    Thank you!



  • #2
    Dear Joshua,
    as specified in the spmap help file, option mopattern() relates to "Cartogram" maps only, not to choropleth maps. Actually, I don't remember why I did not include a similar option also for choropleth maps -- or for additional polygons as specified by option polygon(), for that matter. Should I get back to spmap for upgrading it, I'll take care of that. Meanwhile, as a partial workaround, you might try the following:

    Code:
    spmap using "states_coordinates.dta", id(id) line(data("counties_coordinates.dta") size(0.2) color(black) pattern(shortdash))
    Best wishes,
    Maurizio

    Comment


    • #3
      This feature comes standard in ADePT maps. See screenshot.

      http://go.worldbank.org/ODS4NKQBB0
      http://siteresources.worldbank.org/I...DePT_Maps2.pdf

      Best, Sergiy Radyakin


      Click image for larger version

Name:	nepal_dashed.png
Views:	1
Size:	135.1 KB
ID:	1306224

      Comment


      • #4
        Originally posted by Maurizio Pisati View Post
        Dear Joshua,
        as specified in the spmap help file, option mopattern() relates to "Cartogram" maps only, not to choropleth maps. Actually, I don't remember why I did not include a similar option also for choropleth maps -- or for additional polygons as specified by option polygon(), for that matter. Should I get back to spmap for upgrading it, I'll take care of that. Meanwhile, as a partial workaround, you might try the following:

        Code:
        spmap using "states_coordinates.dta", id(id) line(data("counties_coordinates.dta") size(0.2) color(black) pattern(shortdash))
        Best wishes,
        Maurizio
        Thank you, Maurizio. It really helps. I have one final question: if I have a variable at county level and would like to use different colors for different counties, according to this variable, how can I do that? I mean, I started from the counties coordinates to be able to do that. Thanks again!

        Comment


        • #5
          Sorry if the previous message wasn't clear. I need to fill in the polygon with different colors (according to a county level variable) and have their borders dashed. Thank you again!

          Comment


          • #6
            Dear Joshua,
            you might try something like this:

            Code:
            use "counties_data.dta", clear
            spmap YOURVAR using "counties_coordinates.dta", id(id) ocolor(none ..) ///
               polygon(data("states_coordinates.dta") osize(0.3) ocolor(black))    ///
               line(data("counties_coordinates.dta") size(0.2) color(black) pattern(shortdash))
            where counties_data.dta is the Stata dataset containing the county id variable and the county-level variable YOURVAR.


            Best wishes,
            Maurizio

            Comment


            • #7
              Thank you very much for your help. I really appreciate it. It goes without saying it perfectly works! Thank you again!

              Comment

              Working...
              X