Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: graphing and shading


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: Re: graphing and shading
Date   Tue, 3 Jun 2003 19:35:57 -0500

----- Original Message ----- 
From: "John D. Levendis" <[email protected]>
To: "statalist" <[email protected]>
Sent: Monday, June 02, 2003 9:28 PM
Subject: st: graphing and shading


> Hi everyone,
>
> I've got a quation regarding the new graphing facilities in STATA8.
>
> Lets say I've got some GDP data over time. Stata provides a means whereby
I can
> demarcate a year using xline. Thus, I could show the great depression as
the
> area between two vertical lines:
> - twoway connected gdp time, xline(1929 1945)
>
> But lets say that I'd like to shade the area between two years (useful if
I
> want to have a bunch of intervals indicating time of recession. Is there a
way
> to do this in STATA?
>
> Thanks.
>
> --John
>

John,

A similar question came up last month.  Gerald Wright ([email protected])
came up with this example to show how it may be done:

preserve
sysuse gnp96,clear
sum gnp
local max=`r(max)'
gen c=`max' if date>q(1992q1)&date<q(2001q1)
lab var c "Clinton Years"
twoway (area c date, bcolor(gs15)) (line gnp date, clpattern(solid))
restore

Hope this helps,
Scott



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index