Announcement

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

  • add space between ytitle and labels

    I often use the height() option in ytitle() in order to add space between the text and the labels. However, I'm adding an alternate axis on the right side and I'm having trouble doing something similar.

    Consider the following code. (The height is exaggerated and the box option is added just to make it clearer.)

    Code:
    sysuse auto
    scatter price rep78 , yti("Dollars", height(10) box) || scatter mpg rep78 , yaxis(2) yti("MPG", height(10) axis(2) box)
    I thought the obvious thing to do was push the text to the "bottom" of the box by adding the align() option:

    Code:
    scatter price rep78 , yti("Dollars", height(10) box) || scatter mpg rep78 , yaxis(2) yti("MPG", height(10) axis(2) box align(bottom))
    However, this option does not return an error yet does not change the plot at all. If there isn't a way to move the text within the box, maybe there's a way to push the box itself away from the labels?

    I'd very much appreciate any advice. Thank you.

  • #2
    ysc() has an suboption titlegap()

    Comment


    • #3
      I often use a blank title line for spacing purposes. This generally works OK; and I find it easier to remember than "ysc(, titlegap(10))" or whatever:
      scatter price rep78 , yti("Dollars" " ", height(10) ) || scatter mpg rep78 , yaxis(2) yti(" " "MPG", height(10) axis(2) )

      Comment

      Working...
      X