Announcement

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

  • turn off dotted lines in marginsplot, recast(dot)

    Dear Statalist,

    Does anyone know how to get rid of the vertical dotted lines in the plot below? I tried adding " dots(mcolor(bg))" to the end of the marginsplot command, but Stata would not allow that.

    Thanks,

    Jeremy

    webuse nhanes2f, clear
    logistic diabetes i.agegrp
    margins, over(agegrp)
    marginsplot, recast(dot) xdim(agegrp)

  • #2
    You can specify a color matching the background depending on your scheme, e.g.,

    Code:
    marginsplot, recast(dot) xdim(agegrp) plotopts(dcolor(white))

    Comment


    • #3
      Thanks, Andrew. Is there also a way to turn the dots off (or hide them better)?
      When I make the graph more complicated (see below), the white dotted lines affect how other items appear.
      Jeremy

      webuse nhanes2f, clear
      logistic diabetes i.black i.agegrp
      margins black, over(agegrp)
      marginsplot, recast(dot) xdim(agegrp) plotopts(dcolor(white))

      Comment


      • #4
        you can turn off the color (i.e., make it "transparent") - see
        Code:
        help colorstyle

        Comment


        • #5
          Thank you! The code below worked.

          Jeremy

          webuse nhanes2f, clear
          logistic diabetes i.black i.agegrp
          margins black, over(agegrp)
          marginsplot, recast(dot) xdim(agegrp) plotopts(dcolor(white%0))

          Comment

          Working...
          X