MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plotting stacked lineplots

On Oct 30, 8:29 pm, Deep <deepankar.sha... at> wrote:
> Is it possible to use mathematica to plot stacked lineplots as shown
> at
> ?
> Regards,
> Deepankar


Suppose you have say 6 lists of date list data, and that each data set
has identical dates

data = {data1, data2, data3, data4, data5, data6};

the values at each date are data[[All, All, 2]]

so you can make a cumulative set of values

newData = data;
newData[[All, All, 2]] = Transpose[MapThread[Accumulate[{#1, ##2}] &,
data[[All, All, 2]]]]

and once you have your new data you can plot it

range = Range[0, Length[data]];

DateListPlot[newData, Joined -> True,
 Filling -> (MapThread[#2 -> {{#1}, ColorData[3, #2]} &, {Most[range],
Rest[range]}] /. {0} -> Bottom)

note that the filling might need some tweeking.


  • Prev by Date: Re: I cant get step by step solution @ this diferantial equation
  • Next by Date: Re: Simple question about inverse of a function
  • Previous by thread: Re: Plotting stacked lineplots
  • Next by thread: Re: Plotting stacked lineplots