Announcement

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

  • Add Text to Graph Combine

    I am combining three graphs using 'graph combine'. By default they appear in a 2 x 2 arrangement with the lower right slot empty. I'd like to add text to this empty area. What's the best way to do this?

    I have tried the 'caption' and 'note' options, with and without the 'position' suboption, but that distorts the shape or is at the far bottom of the combined graph.

    I don't know if this would work, but if I could either save the text as a standalone .gph file, I could add that way, or perhaps there is an option I'm missing for 'graph combine' whereby you can just place text anywhere you like (using coordinates, not clock position).

  • #2
    Yes, you can create an empty graph with text to fill in the empty hole

    Code:
    sysuse auto,clear
    forv i = 1/3 {
        scatter price mpg, name(gr`i',replace)
    }
    //To make placement easier
    count
    gen x = _n/r(N)
    gen y = _n/r(N)
    scatter y x, name(gr4, replace) msymbol(none)  /// 
      xlabel(,nogrid) ylabel(,nogrid) yscale(off) xscale(off) /// 
      text(.5 .5 "Example Text" "Row 2" ,size(huge))
    
    graph combine gr1 gr2 gr4 gr3
    Click image for larger version

Name:	Graph1.png
Views:	1
Size:	44.7 KB
ID:	1501068

    Comment


    • #3
      Thanks! That should work perfectly.

      Comment

      Working...
      X