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

st: Re: graphing and shading

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

----- Original Message ----- 
From: "John D. Levendis" <>
To: "statalist" <>
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
> 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
> want to have a bunch of intervals indicating time of recession. Is there a
> to do this in STATA?
> Thanks.
> --John


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

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))

Hope this helps,

*   For searches and help try:

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