Pergunta

I have a project that will requiring graphing data (with Python). rrdtool seems to be almost exactly what I need- except it only supports 1 second resolution and my data points are much closer together.

GNUPlot looks like a beast. I've not dug into it yet, but in a cursory glance, it seems more tailored to graphing expressions and not something to be learned quickly.

Is there another (hopefully relatively easy to use) graphing system tailored or easily adaptable to graphing time series? If there is nothing better then GNUplot, I will start digging into it- I just wanted to be sure there is nothing else I should consider.

Foi útil?

Solução

I've made use of PyX before. It's served my purposes well when I needed to graph various data.

There's also matplotlib, which is a very popular Python plotting library.

Outras dicas

You don't fully specify what you are looking for, but here is a quick cut and paste-able example that shows some of the plotting abilities of matplotlib. The example also saves the image as a png and pdf (rasterized and vectorized respectively):

import numpy as np
import pylab as plt

# Create some sample "time-series" data
N = 200
T = np.linspace(0, 5, N)
Y1 = T**2 - T*np.cos(T*5) + np.random.random(N)
Y2 = T**2 - T*np.sin(T*5) + np.random.random(N)

pargs = {"lw":5, "alpha":.6}

plt.plot(T,Y1, 'r',**pargs)
plt.plot(T,Y2, 'b', **pargs)

skip = 30
plt.scatter(T[::skip],Y2[::skip], color='k', s=200, alpha=.6)

plt.xlabel("time")
plt.ylabel("money")
plt.axis('tight')

# Save as a png and a pdf
plt.savefig("example.png")
plt.savefig("example.pdf")

plt.show()

enter image description here

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top