Announcement

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

  • How to superimpose grid on a map

    Hello Everyone
    I am trying to superimpose grid on my map in stata. I could not find proper way of doing that.
    I also check GRMAP help however I could not find any option regarding grid.
    this is my code
    use RawData2011_2020.dta

    grmap ETHANOLrp, t(18635) legtitle("fuel") fcolor(Reds2) clnumber(4) ocolor(Greys) clmethod(quantile) polygon(data(mp_shp.dta) ocolor(black))

    I appreciate your insights ahead of time.


  • #2
    You can turn on the x&y scales and grids. Note - this places in grid under the map rather than superimposed on the map.

    This example use Nick Cox's -mylabels- (ssc desc mylabels) for convenience
    Code:
    clear
    use "italy-regionsdata.dta", clear
    mylabels 38  58 78 98 115, myscale(10000*@) local(myxla)
    mylabels 42  44.5 47 49.5 52, myscale(100000*@) local(myyla)
    grmap relig1, xscale(on) xlabel(`myxla', grid) ylabel(`myyla', grid) yscale(on)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	55.2 KB
ID:	1648282

    Comment


    • #3
      Thank you Scott,
      it works for me.
      Could you possibly let me know where I can find description of these option? I could not find xscale /xlabel in the GRMAP help file
      Regards

      Comment


      • #4
        Most twoway options can be passed to -grmap-. If you look under basemap_options it will list:
        Y axis, X axis, Titles, Legend, Overall
        twoway_options

        Comment


        • #5
          Thank you, Scott!

          Comment

          Working...
          X