Announcement

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

  • combining many graphs

    Dear Stata users,

    I am wondering, is it possible to combine graphs (combining more than 4 graphs) as below using Stata 15?

    Using -graph combine- I could combine 2 graphs only.

    Click image for larger version

Name:	For statalist_cvd.png
Views:	1
Size:	107.6 KB
ID:	1492611


    Any help would be greatly appreciated.

    Thank you.
    Regards,
    Oyun


  • #2
    graph combine does not limit you to combining only two graphs:

    Code:
    sysuse auto, clear
    forvalues i = 1/5 {
        twoway scatter price mpg if rep78 == `i' , name(gr`i', replace)
    }
    
    graph combine gr1 gr2 gr3 gr4 gr5
    The kind of graph you are showing (e.g. with a common x and y axis) is typically done with the by() option:

    Code:
    twoway scatter price mpg, by(rep78, compact note(""))
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you so much for your help Maarten.
      Last edited by Buyadaa Oyunchimeg; 10 Apr 2019, 18:35.

      Comment


      • #4
        May I ask one more question.

        Is it possible to adjust or change the size of each graph in combined graph using graph editor?



        Click image for larger version

Name:	multiple graph_stata1.png
Views:	1
Size:	78.1 KB
ID:	1492755 .


        In my case, I want to make changes in size so that all graphs have the same size. As you can see (attached graph), graphs in the last row have different size compared with others (smaller size of y-axis). The size of x-axis of 2 columns are not the same too.

        Thank you so much.
        Last edited by Buyadaa Oyunchimeg; 10 Apr 2019, 20:04.

        Comment

        Working...
        X