Announcement

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

  • spmap_fix color of a certain index

    Dear Statalist,

    I would like to fix colour for category using spmap. For example, I want to express a certain index

    o<ind<0.5 'light blue'
    0.5<ind<1 'dark blue'
    -0.5<ind<0 'light red'
    -1<ind<-0.5 'dark red'
    The purpose of doing this is to compare two maps.
    Code:
    spmap ind_sar using a_coord, id(stid) legend(position(2)) legtitle("Ind") fcolor(Reds2) ocolor(blue) osize(vthin)
    Many thanks in advance!

    Kind regards,

    Sungwook

  • #2
    You can specify a color list in spmap. You do not have to use the color palettes. For example you could alter the intensity of the color or specify them directly (in this case in terms of RGB):

    Code:
    use "Italy-RegionsData.dta", clear
    spmap relig1 using "Italy-RegionsCoordinates.dta", id(id) clm(custom) /// 
        clb(20 40 50 60 70) fcolor( red*.5 red*1.25 blue*.5 blue*1.25)
    spmap relig1 using "Italy-RegionsCoordinates.dta", id(id) clm(custom) /// 
        clb(20 40 50 60 70) fcolor( "0 0 255" "179 179 255" "255 179 179" "255 0 0")

    Comment


    • #3
      Thank you so much for your help, Scott. It is really appreciated!

      Kind regards,

      Sungwook

      Comment

      Working...
      X