Re: Highlighting data sections with a different
- To: mathgroup at smc.vnet.net
- Subject: [mg102420] Re: [mg102404] Highlighting data sections with a different
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 9 Aug 2009 06:03:15 -0400 (EDT)
- Reply-to: hanlonr at cox.net
data = FinancialData["IBM", "Jan. 1, 2004"];
min = Floor[Min[data[[All, 2]]]];
max = Ceiling[Max[data[[All, 2]]]];
data2 = data /. {d_, v_} -> {d, If[v < 80, max, min]};
Show[{
DateListPlot[data2,
Filling -> min,
PlotStyle -> Transparent],
DateListPlot[data,
Joined -> True]
}]
Show[{
DateListPlot[data2,
PlotStyle -> Transparent,
Filling -> min,
FillingStyle -> LightBlue],
DateListPlot[data,
Joined -> True,
ColorFunctionScaling -> False,
ColorFunction ->
Function[{d, v},
If[v < 80, Red, Lighter[Blue]]]]
}]
Bob Hanlon
---- Tyler <hayes.tyler at gmail.com> wrote:
=============
Hello All:
I was wondering if someone could point me in the right direction on
how to shade the background of certain regions on a plot. More
specifically, I am interested in using DateListPlot and FinancialData
to produce a similar economic chart as "Chart 2" found here:
http://www.economicsnapshots.com/archives/2006/snap20060705.htm
I've thought of using both "Filling" and/or "BackGround" but frankly
have gotten nowhere. Any hints on how to approach this?
Cheers,
t.