Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Grid lines on top of shaded time series graph

From   Nick Cox <>
Subject   Re: st: Grid lines on top of shaded time series graph
Date   Mon, 31 Oct 2011 08:34:53 +0000

Your calls to -twoway function- can also specify a -lcolor()- to give
sharper definition to the periods of recession.


2011/10/30 Jorge Eduardo Pérez Pérez <>:

> I have been creating time series graphs for several countries with
> recession shading, following the code on the user written command
> -nbercycles- by Christopher Baum.
> Following a example from -nbercycles-
> ssc install freduse, replace
> freduse MPRIME, clear
> gen ym = mofd(daten)
> tsset ym, monthly
> twoway function y=20.705,range(119 130) recast(area) color(gs15)
> base(4.7025) || ///
> function y=20.705,range(166 182) recast(area) color(gs15) base(4.7025) || ///
> function y=20.705,range(240 246) recast(area) color(gs15) base(4.7025) || ///
> function y=20.705,range(258 274) recast(area) color(gs15) base(4.7025) || ///
> tsline MPRIME if tin(1970m1,1990m1), xlabel(,format(%tm))
> legend(order(5 1 "Recession")) tlabel(,grid)
> I would like the horizontal and vertical grid lines on the graph to be
> on top of the shading. Does anyone know how to do this?

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index