Hello everybody,

I have a queation about graph combine, or in my specific case grc1leg, but since the latter is a wrapper of the former the solution should fit to both commands.
If this has been answered many times before I apologize, but I didn't find related posts on the forum.

Here's my problem: After combining the graphs I would like only one xtitle for both graphs (so I dont have the same xtitle below each subgraph).
I tried using a b1-title in the grc1leg, but then the title is displayed below the legend, which looks odd.
Does anyone know how to get the title above the legend?

Actually, I'd like to replicate the outcome of using the by()-option of twoway.

Heres a code example:
Code:
sysuse auto, clear

* Desired outcome using by-option:
twoway (scatter price headroom, by(foreign, graphregion(color(white)))) ///
       (qfit price headroom), ///
       ytitle("Price")
        
* My try on it:
global graphnames
forv i=0/1 {
    twoway (scatter price headroom if foreign==`i') ///
           (qfit price headroom if foreign==`i'), ///
    title("Foreign=`i'") ///
    xtitle("") ytitle("") ///
    graphregion(color(white)) ///
    name(gr_`i', replace) nodraw
    
    global graphnames $graphnames gr_`i'    
}
grc1leg $graphnames, ycommon xcommon graphregion(color(white)) rows(1) b2title("Headroom") l1title("Price")

// ... they are not identical...
Here's the output of the by-option:
Array
And that's what I get when trying to replicate it by using grc1leg:
Array