Announcement

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

  • Stacking multiple plots vertically with the same X axis but different Y axes

    Hi

    I am having issues combining a particular set of graphs in stata so that the ouput looks something like the below.

    Currently I have used:
    graph combine - the output of this does not stack the charts exactly on top of one another and there isn't an option for them to share the same x axis
    graph, by(group) - this could provide the same x axis but the graphs are still separated by a space

    Are there any other options or user written programs I am missing that could replicate the below output? (this was produced in R)

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	86.8 KB
ID:	1670408

  • #2
    by(group, compact) squeezes panels together.

    Otherwise check out https://www.statalist.org/forums/for...ailable-on-ssc

    The compact suboption can be specified using this syntax:

    Code:
    webuse grunfeld, clear
    multiline invest kstock mvalue year if company==1, by(compact)

    Comment


    • #3
      Thank you Nick very helpful

      Comment

      Working...
      X