Dear Statalists,

I plotted some impulse response functions and I had to combine two graphs and their respective legends (different). In order to solve the problem I just included an additional element (line of the second graph) in the legend of the first graph. However, I get a neutral symbol (i.e. without the line color, pattern and width of the original line). I highlight in red in the code (i) where I included the additional element in the legend of the first graph, without reference to any line, (ii) the line color, pattern and width of the line in question.

The code is the following
Code:
Code:
 gen _h = h if h<=8;
gen _zero = 0;  

twoway  (line _zero h if h>=1 & h<=16, lcolor(black) lpattern(solid) ) ///        
              (line multexp1  h if h>=1 & h<=16, connect(l) lcolor(navy) lpattern(solid) lwidth(thick)) ///        
              (rarea up90fb lo90fb h if h>=1 & h<=16, lcolor(navy%20) fcolor(navy%20) lwidth(none)) ///        
              (line up90hb h if h>=1 & h<=16, lcolor(cranberry) lpattern("_###_###") lwidth(medthick)) ///        
              (line lo90hb h if h>=1 & h<=16, lcolor(cranberry) lpattern("_###_###") lwidth(medthick)) ///        
              (scatter multrec1  h if h>=1 & h<=16, connect(l) lcolor(cranberry) lpattern(solid) lwidth(thick) msymbol(C) msize(medlarge) mcolor(cranberry)), ///        
              xscale(range(1 16)) xlabel(2(2)16) xtitle("quarter") ylabel(, format(%03.1f) angle(0)) legend(order(2 "High private debt" 6 "Low private debt" 1 "Difference")  size(small)) graphregion(color(white)) bgcolor(white);        

graph rename full_model, replace;  

twoway  (line _zero h if h>=1 & h<=16, lcolor(black) lpattern(solid)) ///        
              (rarea up90diff lo90diff h if h>=1 & h<=16, fcolor(eltgreen%50) lcolor(eltgreen%50) lwidth(none)) ///        
              (line diff1  h if h>=1 & h<=16, lcolor(green) lpattern("longdash") lwidth(thick)) ///        
              ,xscale(range(1 16)) xlabel(2(2)16) xtitle("quarter") ylabel(, format(%03.1f)  angle(0)) legend(order(3 "Difference")) graphregion(color(white)) bgcolor(white);        

graph rename diff_model, replace;          

grc1leg2 full_model diff_model, title("US `graphname' multiplier",size(medsmall) span) rows(1) c(1) xsize(2.5) legendfrom(full_model)  lcols(3) ltsize(small)  graphregion(color(white)) graphregion(margin(zero));
I would like to automatize the code so I don't need to manually change the line color, pattern and width in the legend for the added element ("Difference").

Let me attach also a figure in case I didn't make clear my point.
Array

Thanks,
Alessandro