Announcement

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

  • Common x and ytitle for combined graphs

    Hello statalisters,

    I'm combining graphs one next to the other and I would like to display a common ytitle (on the left side) and a common xtitle just in the middle of the two graphs. I cannot figure out how to do this in stata (is it even possible btw?) because graph combine does not allow x/ytitle option.

    One solution could be to leave the ytitle of the left graph, but then How do I add the common xaxis?

    Code:
    graph combine graph1 graph2, title("COMMON TITLE") ycommon xcommon graphregion(color(white)) // ytitle("Density") xtitle("x-axis title") : Doesn't work

  • #2
    As the help explains, graph combine allows other title options. Don't be put off by the wording "rarely used". I use several of those options frequently. Here is a dopey example:

    Code:
    sysuse auto
    scatter mpg weight , name(g1)
    scatter mpg price , name(g2)
    graph combine g1 g2, l1(Miles per gallon) b1(Interesting predictors)

    Comment


    • #3
      Ok great. Thanks a lot .
      I posted this twice by error, sorry.

      Comment


      • #4
        With the l1 and b1 options, is there a way to center, or otherwise control, where this text would appear? For example, if you wanted the "Interesting predictors" to appear with "Interesting" under the first graph and "predictors" under the second? Clearly you could do this in the initial construction of each of the two graphs, but is there a way to finely control this labeling with the graph combine command?

        Comment

        Working...
        X