RuntimeError: xdata and ydata must be the same length

Hello,
I'm using matplotlib like that:

import matplotlib
matplotlib.use("Agg")
import pylab
pylab.plot(*values)
pylab.savefig("testfig.png")

print values gives this output:

[['1', '2', '3', '4', '5'], ['11', '12', '13', '14', '15']]

But the pylab.plot(*values) gives a traceback:

Traceback (most recent call last):
  File "visualizer.py", line 8, in ?
    main()
  File "visualizer.py", line 6, in main
    g.createGraphs()
  File "/home/florian/visualizer/GraphCreator.py", line 21, in createGraphs
    pylab.plot(*values)
  File "/usr/lib/python2.3/site-packages/matplotlib/pylab.py", line 1899, in
plot
    ret = gca().plot(*args, **kwargs)
  File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 2409, in
plot
    for line in self._get_lines(*args, **kwargs):
  File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 271, in
_grab_next_args
    yield self._plot_2_args(remaining, **kwargs)
  File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 226, in
_plot_2_args
    markerfacecolor = c,
  File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line 135, in
__init__
    self.set_data(xdata, ydata)
  File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line 202, in
set_data
    raise RuntimeError('xdata and ydata must be the same length')
RuntimeError: xdata and ydata must be the same length

What am I doing wrong?

Thanks,
Florian

Florian Lindner wrote:

Hello,
I'm using matplotlib like that:

import matplotlib
matplotlib.use("Agg")
import pylab
pylab.plot(*values)
pylab.savefig("testfig.png")

print values gives this output:

[['1', '2', '3', '4', '5'], ['11', '12', '13', '14', '15']]

What am I doing wrong?

Passing strings. Use numbers.

···

--
Robert Kern
rkern@...376...

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter