ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 27 Feb 2012 16:21:21 +0100Multiple time-series(MS excel line graph) style plotshttps://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/Hello you wise sages,
I have several lists of 1 dimensional data which I would like to plot on one set of axes, in a time series format.
More info:
I can plot one set this way:
1dlist = [34,52,65]
t = finance.TimeSeries(1dlist)
t.plot()
So if I had 2 lists, 1dlistA and 1dlistB, how would I overlay plots of them both?Mon, 27 Feb 2012 15:48:20 +0100https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/Answer by I. Noobton for <p>Hello you wise sages,</p>
<p>I have several lists of 1 dimensional data which I would like to plot on one set of axes, in a time series format.</p>
<p>More info:</p>
<p>I can plot one set this way:</p>
<pre><code>1dlist = [34,52,65]
t = finance.TimeSeries(1dlist)
t.plot()
</code></pre>
<p>So if I had 2 lists, 1dlistA and 1dlistB, how would I overlay plots of them both?</p>
https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/?answer=13307#post-id-13307nevermind, I figured it out. It's done like this:
a = finance.TimeSeries(1dlistA)
b = finance.TimeSeries(1dlistB)
both = a.plot() + b.plot()
both.plot()
Mon, 27 Feb 2012 15:56:10 +0100https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/?answer=13307#post-id-13307Comment by Shashank for <p>nevermind, I figured it out. It's done like this:</p>
<pre><code>a = finance.TimeSeries(1dlistA)
b = finance.TimeSeries(1dlistB)
both = a.plot() + b.plot()
both.plot()
</code></pre>
https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/?comment=20232#post-id-20232I think you meant both.show() in the last line.Mon, 27 Feb 2012 15:57:50 +0100https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/?comment=20232#post-id-20232Comment by kcrisman for <p>nevermind, I figured it out. It's done like this:</p>
<pre><code>a = finance.TimeSeries(1dlistA)
b = finance.TimeSeries(1dlistB)
both = a.plot() + b.plot()
both.plot()
</code></pre>
https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/?comment=20231#post-id-20231Or just "both", perhaps!Mon, 27 Feb 2012 16:21:21 +0100https://ask.sagemath.org/question/8748/multiple-time-seriesms-excel-line-graph-style-plots/?comment=20231#post-id-20231