Announcement

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

  • btitles on same line

    I am making a histogram and would like two x-axis titles: one aligned to the left side of the x-axis and one aligned to the right side of the x-axis. Importantly, I would like these titles to appear on the same line. Is there a way to do this automatically rather than manually? (i.e., I don't want to extend the graph margins/add a bunch of spaces to the x title.)

    The below is almost what I want, except for the fact that the b2title is not on the same line as the b1title:

    Code:
    sysuse auto, clear
    gen headroom_gear_diff = headroom - gear_ratio
    histogram headroom_gear_diff, xtitle("") b1title("Headroom > Gear Ratio →", place(e)) b2title("← Headroom < Gear Ratio", place(w))
    This generates the following: Click image for larger version

Name:	Graph.png
Views:	1
Size:	39.4 KB
ID:	1710828

  • #2
    Thre are no such options for titles. Probably use the -text()- option for both to avoid fiddling with positions.

    Code:
    sysuse auto, clear
    gen headroom_gear_diff = headroom - gear_ratio
    set scheme s1mono
    histogram headroom_gear_diff, xtitle("") ///
    b2title("Headroom > Gear Ratio →", place(e)) ///
    text(-.045 -1.75 "← Headroom < Gear Ratio", size(medium))
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	25.6 KB
ID:	1710834

    Comment

    Working...
    X