|
From: John H. <jd...@gm...> - 2008-04-29 12:23:37
|
On Tue, Apr 29, 2008 at 7:12 AM, Daniel Lidström <dan...@sb...> wrote:
> This is it. The script is a multiplot script, but how to do that part with
> matplotlib
> I think I can work out myself. I am printing two graphs that contain
> "issues" and "tests".
> These values are displayed over time. The data looks like this (both input
> files):
>
> 200711291206 52
> 200711291257 52
> 200711291359 52
I am not a gnuplot user, but I can offer a couple of suggestions.
First, matplotlib has a plotfile command inspired by gnuplot, so you
can use it to plot data from your file. Secondly, recent versions (eg
0.91.2) have transparent support for dates and record arrays, so one
easy solution is to do (assuming your file has headers "date" and
vals" in the example below)
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
r = mlab.csv2rec('myfile.dat', delimiter=' ')
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(r.date, r.vals)
fig.autofmt_xdate()
plt.show()
|