Announcement

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

  • Different Marker Sizes for spmap

    All - I am using the spmap function in stata and have been reading the documentation and have not been able to get multiple marker sizes when I use the by() command in spmaps. I have read through the documentation numerous times and have tried different ways of inputting size(markersizestyle_list) but I still seem to always get just one marker size based on the first number. If anyone has done this before and knows how to get it to work I would really appreciate it. Thank you for the help!

    Here is the line of code I am using:

    spmap lambda using GridCells, id(spgrid_id) clnum(20) fcolor(Reds2) ocolor(none ..) ///
    legend(off) point(data(All Addresses) xcoord(longitude) ycoord(latitude) ///
    fcolor(yellow blue) by(b) size(*.1 1))

    Best,
    Greg

  • #2
    Dear Greg,
    you're right, there is a bug in spmapI've been aware of for some time, but never had the time to fix it. I hope I'll be able to revise and resubmit the command in the next few weeks.
    Best wishes,
    Maurizio

    Comment


    • #3
      Thank you so much for letting me know Maurizio. I appreciate your help. By the way I really like spmap / your tutorials it's an excellent tool!

      Comment


      • #4
        Hi Maurizio and others,

        I think I have a similar problem as Greg. I have plotted points on a map proportional to a variable. I want a legend showing what several of the point sizes correspond to in terms of the value of that variable. Like Greg I've been looking through the documentation and can't figure out how to produce this.

        My code is below:

        spmap admind using "nigtwo.dta" if departmentid==1, id(id) ocolor(black) fcolor(none) osize(thin) clmethod(quantile) legenda(off) ///
        title("ABC-2 Villages", size(*.75)) ///
        subtitle("Weighted by Percent of HHs with Migrant", size(*1)) ///
        point(data("ABCGeoandWeights.dta") x(longitude) y(latitude) ///
        legenda(on) legtitle(Legend) by(migrate_hh) ///
        fcolor(none) ocolor(black) legshow(1 7 14 21 28) proportional(migrate_hh) size(*.4)) ///
        label(data("nigoneABCdepts.dta") label(ADM2) xcoord(x_stub) ycoord(y_stub) size(*1) position(0 2) length(30)) ///
        note(" " ///
        "Note: Blah Blah Blah", size(*.7)) ///
        line(data("nigrdstwoABCdeptlevel.dta") color(orange) size(thin))

        Best,

        Seb

        Comment


        • #5
          Hi

          Just wanted to check in to see if the bug has been fixed? I am using spmap with point markers that are colour coded proportional to a variable. When I try and change the size of all of the markers it only changes the marker size of the first category in the legend.

          Code:
          spmap using "$maps/rsacoord_lm.dta", id(_ID) point(data("$temp\temp1.dta") by(n) size(small) fcolor(Blues2) xcoord(d14_long) ycoord(d14_lat) legenda(on) legtitle(Number RCs))
          Best
          Megan

          Comment


          • #6
            Originally posted by Megan Little View Post
            Just wanted to check in to see if the bug has been fixed?
            Have you tried grmap?
            Code:
            help grmap

            Comment


            • #7
              Dear Readers

              Following up on this - grmap does not seem to solve this, or a closely related problem. The legend for points (proportional) by(by_var) displays points in the legend by colo[u]r not by size. Also the size of points in teh legend seem to be controled by the size(option) - which does not seem to be documentd in the help.

              This makes the points in the legend difficult to read in conjunction with size(timy), which I use to keep the points to a reasonable size on the map. I have experimented with the various commands to control the point size (prange) and dmax() but I can't see that they are able to control the size of ponts on the map while allowing a reasonable size of point symbol in the points legend.

              All help as ever gratefully acknowledged.

              Richard

              Comment


              • #8
                After a bit of experimentation, I found out the answer. incest two dots followed by a space such as size(*1 ..). Here is my code which eventually worked.

                spmap using "india_coord.dta", ///
                id(_ID) oc(blue) osize(vthin) ///
                point( by(source_public) ///
                x(longitude) y(latitude) size(*0.01 ..) fcolor(Blues2) ) ///
                polygon( ///
                data("India_coord.dta") ///
                ocolor(blue ..) osize(vvthin ..))

                Comment

                Working...
                X