Announcement

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

  • Added text in twoway graphs (bug?)

    Dear Statalist community,

    I've encountered some strange behavior with added text in twoway graphs.

    To my understanding, added text should be subject to the same formatting options as captions, headings, etc. However, this does not seem to be the case:
    Code:
    sysuse auto, clear
    
    * captions
    scatter price weight, /// Basic
        caption("My caption", ring(0) position(7) box) name(g1, replace)
    scatter price weight, /// + bmargin
        caption("My caption", ring(0) position(7) box bmargin("2 0 2 0")) name(g2, replace)
    scatter price weight, /// + lcolor
        caption("My caption", ring(0) position(7) box bmargin("2 0 2 0") lcolor(none)) name(g3, replace)
    
    * textboxes
    scatter price weight, /// Basic
        text(0 2000 "My Text", box) name(g4, replace)
    scatter price weight, /// + bmargin
        text(0 2000 "My Text", box bmargin("2 0 2 0")) name(g5, replace)
    scatter price weight, /// + lcolor
        text(0 2000 "My Text", box bmargin("2 0 2 0") lcolor(none)) name(g6, replace)
    scatter price weight, /// + fcolor + bcolor
        text(0 2000 "My Text", box bmargin("2 0 2 0") lcolor(none) fcolor(gray) bcolor(gray)) name(g7, replace)
    For captions, all options work just fine. For textboxes, however, the bmargin option doesn't do anything (interestingly, margin(...) does take effect). Removing the outline color of the textbox also removes its fill color (g5 vs. g6), and it seems impossible to get the fill color back (g7).

    Am I missing something? Is added text a different beast altogether? Or is this a bug? From the documentation, I would assume captions and textboxes to work the same when it comes to these options.

    I am using Stata 17 on Windows 11.
Working...
X