Announcement

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

  • Change label, color, and font for "by(category)" graph

    Dear Statalist user,

    I use a very similar visualization to this:

    Code:
    use https://www.stata-press.com/data/r17/auto, clear
    scatter mpg weight, by(foreign)
    I am now trying to change the label, font, and color for the "Foreign" and "Domestic" boxes. For example, the text should be changed to "Foreign Car" and "Domestic Car", the field should be in light gray and the text should be bold.

    I was probably just using the wrong keywords to find the answer, so I would appreciate any pointers.

    Best,

    Marvin

  • #2
    Code:
    use https://www.stata-press.com/data/r17/auto, clear
    label define origin 0 "{bf:Domestic Car}" 1 "{bf:Foreign Car}", modify
    scatter mpg weight, by(foreign) subtitle(,bcolor(gs14))
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you for your quick reply, Maarten! That did the trick.

      Comment

      Working...
      X