I would like to create
Hi everyone,
I am trying to do a graph with shaded areas. The graph enclosed is what I am trying to do.
but I have a little problem. I want that the shaded areas go from the bottom to the top. I tried to create the following code, but works partially:
Code:
sum N100 tempvar ylow yhigh gen `ylow' = floor(r(min)) gen `yhigh' = ceil(r(max)) * * * #d ; xtline N100, over addplot( line N100 t if c=="GE":clab, lw(*2) lc(red) || scatter N100 t if !inlist(c,10,26) & t==ym(2023,3), ms(i) mlab(c) mlabcol(gs0) mlabpos(3) || scatter N100 t if inlist(c,10,26) & t==ym(2023,3), ms(i) mlab(c) mlabcol(gs0) mlabpos(2) || rarea `ylow' `yhigh' lockdown1_0320_0620, color(gs3%10) || rarea `ylow' `yhigh' lockdown2_0121_0521, color(gs3%10) ) xline(`=ym(2017,8)' `=ym(2017,11)' `=ym(2020,3)' `=ym(2020,11)' , lc(gs0) lp(-) lw(thin)) text( 150 `=ym(2017,8)' "W{sup:NE}{sub:min}" // sal.min. 08/2017 150 `=ym(2018,2)' "W{sup:JU}{sub:min}" // sal.min. 02/2018 150 `=ym(2020,3)' "Mesures Covid" 150 `=ym(2020,11)' "W{sup:GE}{sub:min}" , place(n) m(b=3) size(vsmall) ) ylab(60(10)150, labs(small)) xlab(`=ym(2015,1)'(12)`=ym(2023,3)', format(%tmNN.CCYY) labs(small)) ysc(r(60 150)) yti("Nombre de chômeurs") xti("") legend(order(7 1 2 3 4 6) lab(7 "GE") row(1)) ysiz(15) xsiz(30) graphr(m(t=7)) name(uXcanton_index, replace) ; #d cr
Thanks in advance.
Michael
Comment