Announcement

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

  • Effective scaling with the graph combine function

    hi I'm trying to use the graph combine option to combine several graphs but when i do so the plots in the combined version are not evenly distributed. you can see that the top left and bottom right are smaller.

    The code I used to produce this is
    Code:
    gr combine "test1" "test2", col(1)  ycommon xcommon
    were test 1 is
    Code:
    gr combine "a1c01" "a2c01"
    and test 2 is
    Code:
    gr combine "a3c01" "a4c01", saving(test2, replace)
    the four graphs used in this come from
    Code:
    twoway (rcap xl xu n, lcolor(blue)) (rcap yl yu n, lcolor(emerald)) (rcap zl zu n, lcolor(red)) (scatter x y z n, mcolor(blue emerald red)),  title("Graph xxx:") subtitle("With Confidence Intervals") ytitle("Blood Glucose Level") xtitle("Time Since Meal") xlabel(0(20)120)  ylabel(, angle(0)) leg(on order(1 2 3)) legend(label(1 "Home") label(2 "Off-Brand") label(3 "Global-Brand")) saving(A`j'C01, replace)
    were `j' is an indicator for individual.

    Any help is greatly appreciated.

    Cheers,
    Daniel

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	40.7 KB
ID:	1363096



  • #2
    Daniel,

    I suspect there might be something else going on here but maybe try combining all of the original graphs at once rather than in a series of -gr combine-'s.

    As always, some data would be helpful to try to reproduce the problem. Also, it doesn't seem likely that the code you've presented is exactly what produced these graphs...the large margin between the y axis titles in the top left and bottom right graphs is odd.

    Lance

    Comment


    • #3
      I agree with Lance. Graphs like these cry out for a different data structure allowing a single graph with four panels to be produced by a single graph command with a by() option.

      Incidentally, note that graph combine is a command, not a function (or an option).

      Furthermore, there may well be sensitivity about what you're showing. That's understood and already addressed in the FAQ Advice:

      If your dataset is confidential, then provide a fake example instead.
      Last edited by Nick Cox; 07 Nov 2016, 11:26.

      Comment

      Working...
      X