Hello, I am trying to add to an area plot three vertical lines overlaying them. I have tried with the xline option but it does not work with any of the options. Could anyone help? Thank you very much!!
This is the dataset:
year hous ba fa
1984 359.45 202.63 120.00
1985 349.58 197.03 117.81
1986 360.49 197.77 121.42
1987 382.94 200.97 124.70
1988 413.83 204.23 125.49
1989 435.12 201.19 128.57
1990 437.66 191.62 127.07
1991 451.60 188.36 124.82
1992 426.45 179.77 127.71
1993 435.00 192.97 137.17
1994 437.33 201.31 143.90
1995 435.18 203.68 147.81
1996 436.18 209.20 154.53
1997 442.92 220.21 163.00
1998 457.71 236.12 176.94
1999 479.38 247.72 186.01
2000 491.84 242.40 180.43
2001 510.23 235.66 173.61
2002 532.28 230.52 167.66
2003 569.33 235.92 168.65
2004 626.14 251.62 178.53
2005 677.88 266.91 188.00
2006 706.25 284.21 201.16
2007 727.35 293.74 206.34
2008 721.79 283.32 193.04
2009 685.89 275.83 191.17
2010 693.44 277.17 194.21
2011 698.54 282.62 201.07
2012 666.29 283.35 207.93
2013 650.72 289.40 218.79
2014 644.67 294.51 227.52
2015 629.20 288.76 223.98
and this is the line of the code:
twoway (area hous year, color("200 0 0")) (area ba year, color("146 195 51")) (area fa year, color("64 105 166")), title("{bf:Level and Composition of Household Wealth in Spain, 1984-2015}", size(medium) color(black)) subtitle(" ", margin(l+0 r+0 b-1 t-1)) xlabel(1984 1991 1998 2006 2014) xtitle("Year", height(4.5)) ylabel(, format(%9.0gc)) ytitle("as a % of national income (in %)", height(5)) legend(lab(1 "Housing") lab(2 "Unincorporated" "business assets") lab (3 "Financial assets") rows(1)) xline(1984(3)2015, lcolor(black) lpattern(dot) lwidth(thin)) xline(1991, lcolor(black) lwidth(thin)) xline(2006, lcolor(black) lwidth(thin)) xline(1998, lcolor(black) lwidth(thin)) graphregion(color(white)) text(845 1987.25 "1st Housing Boom", size(small)) text(845 1994.5 "1st Housing Bust", size(small)) text(845 2002 "2nd Housing Boom", size(small)) text(845 2011 "2nd Housing Bust", size(small)) graphregion(margin(l+0 r+3))
Related Posts with vertical line overlaying an area plot
New Stata module for nonparametric errors-in-variables regressionA new Stata module for estimation of nonparametric errors-in-variables (EIV) regression (and constru…
Imputation QuestionHello everyone, I am performing time series analysis. I have performed multiple imputation on only …
Firm fixed effects with reghdfeHi statalist community, I am working with a dataset that looks like this: Code: input float(abs_DA…
CHAID decision tree to determine significant cutoff of continuous variableI am using Stata 13 SE and have installed the chaid and chaidforest packages. I have a dataset of pa…
Statistical Area fixed effectsHi, I am trying to control for the CBSA (a statistical area) in my dataset. To do this I think I wo…
Subscribe to:
Post Comments (Atom)
0 Response to vertical line overlaying an area plot
Post a Comment