Announcement

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

  • Creating a graph containing another smaller graph

    Dear Statalists,

    Can you give me some advice about how to create a combination of graphs looking like the one attached (a bigger graph with a smaller graph "inside") in Stata? I am trying with graph combine, but it does not seem to be made for more "unusual" graphs combinations..

    Thank you in advance!


    Attached Files

  • #2
    Yes, but not directly. Using the Graph Editor option to determine the graph position offsets.

    Code:
    sysuse auto,clear
    graph bar weight, over(rep) name(gr1,replace) ylabel(0(1000)5000)
    graph pie price, over(foreign) fxsize(30) fysize(30) name(gr2,replace) /// 
     legend(size(*.75) pos(6) row(1) region(color(none)))  /// 
     title(Price by Car Origin, size(*.75) pos(12)) /// 
     pie(1, color("207 225 28")  ) /// 
     pie(2, color("33 144 140")  ) /// 
     graphregion(color(none) margin(zero)) /// 
     plotregion(color(none) margin(zero))
    graph combine gr1 gr2, title(Weight by Repair Record)
    gr_edit plotregion1.graph2.xoffset = -27
    gr_edit plotregion1.graph2.yoffset = 30
    Click image for larger version

Name:	Graph_subplot.png
Views:	1
Size:	39.8 KB
ID:	1652736



    Comment


    • #3
      Thank you very much, Scott!

      Comment

      Working...
      X