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

Re: st: adding lines to graph


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   Re: st: adding lines to graph
Date   Tue, 20 May 2003 21:00:01 -0500

----- Original Message -----
From: "b. water" <[email protected]>
To: <[email protected]>
Sent: Tuesday, May 20, 2003 4:10 PM
Subject: RE: st: adding lines to graph


> i was faced with this problem in the past. what i am suggesting to you is
a
> 'cheat' method but nevertheless pragmatic and works. it is not
> 'stata'tiscally correct but at that time or even now i knew no better but
> here it is anyway. up to you whether you want to deploy it or not.
>
> copy your graph and paste as metafile into either word or powerpoint and
> then drew a square object over the pertinent area of the graph. rt click
on
> the object, choose format object, click transparent and choose 5% grey (or
> color of your liking). that's it.
>
> hope this is helpful.
>
> i know that in the past, mentioning the micros*** raise some antibody
titres
> in this list. so my apology before hand. if anyone else knows how to do
the
> shading in stata, do tell. even i would be interested to know too.
>
> cheers,
> bw

First, what are titres?

Second, I'm not sure if you can shade sub-regions of the graph but you can
shade part of the graph with -twoway area- laid over a line graph.  The
basic idea is to create another series that only contains observations for
the shaded regions.

For example, if you wanted to shade the recessions of a GNP timeseries you
could do the following.

preserve
sysuse gnp96,clear
gen recession = d.gnp if d.gnp < 0
replace rec = 0 if rec ==.
twoway (line d.gnp date  ) (area recession date)
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