Re: Plotting stacked lineplots
- To: mathgroup at smc.vnet.net
- Subject: [mg122543] Re: Plotting stacked lineplots
- From: "Chris Degnen" <degnen at cwgsy.net>
- Date: Mon, 31 Oct 2011 06:52:56 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j8j5ef$f7l$1@smc.vnet.net>
It can be done like this:
data = Table[Accumulate[RandomReal[{0, 1}, 100]], {6}];
stackeddata = Accumulate[data];
preliminary = ListPlot[stackeddata];
colours = Cases[preliminary, _Hue, Infinity];
fillingspec =
Array[# - 1 -> {{#}, Lighter[colours[[#]]]} &,
Length[colours]] /. (0 -> {{1}, col_}) -> (1 -> {Axis, col});
ListLinePlot[stackeddata, Filling -> fillingspec]
Deep wrote:
>
> Is it possible to use mathematica to plot stacked lineplots as shown
> at
> http://www-958.ibm.com/software/data/cognos/manyeyes/page/Stack_Graph_for_Categories.html
> ?
>
> Regards,
> Deepankar
>