Hello,
I am trying to plot a trend line with recessionary periods shaded in grey. Prior posts on this forum address the methods of shading graphs (e.g., https://www.stata.com/statalist/arch.../msg00121.html). These discussions were helpful in creating a graph that nearly does what I want. The problem is that the grey shaded areas are wider on the bottom than on the top. Does anyone know how to make the shaded area have vertical lines perpendicular to the x-axis?
Here is a snippet of data that shows the issue.
This is the command that generates the graph with the tapered areas.
In case it is helpful, I am using Stata/SE 15.1. Thanks.
I am trying to plot a trend line with recessionary periods shaded in grey. Prior posts on this forum address the methods of shading graphs (e.g., https://www.stata.com/statalist/arch.../msg00121.html). These discussions were helpful in creating a graph that nearly does what I want. The problem is that the grey shaded areas are wider on the bottom than on the top. Does anyone know how to make the shaded area have vertical lines perpendicular to the x-axis?
Here is a snippet of data that shows the issue.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(time recession trend) 184 0 5.275247 185 0 5.435284 186 0 5.782407 187 0 5.680537 188 0 5.860635 189 0 5.696178 190 0 5.665268 191 7 5.749439 192 7 5.69439 193 7 5.597833 194 7 5.342285 195 7 5.042449 196 7 4.5402293 197 7 4.2877626 198 0 3.875503 199 0 3.930877 200 0 4.123271 201 0 4.307055 202 0 4.420278 203 0 4.5420003 end format %tq time
Code:
twoway (area recession time, color(gs12)) (line trend time, xlab(184(4)203,labsize(small) angle(45)) yscale(range(0 7)) yla(0(1)7) legend(order(2 1) label(1 "Recession") label(2 "Trend")))
Comment