plot of Series fails #1737

Closed
jgarcke opened this Issue Aug 7, 2012 · 5 comments

Comments

Projects
None yet
3 participants

jgarcke commented Aug 7, 2012

The example here fails with 0.8.1 (worked with 0.8.0)
http://pandas.pydata.org/pandas-docs/dev/computation.html?highlight=outlier#moving-rolling-statistics-moments

In [1]: from pandas import *

In [2]: from numpy.random import randn

In [3]: ts = Series(randn(1000), index=date_range('1/1/2000', periods=1000))

In [4]: ts = ts.cumsum()

In [5]: ts.plot(style='k--')
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip

self.tooltips = gtk.Tooltips()

AttributeError Traceback (most recent call last)

/home/jgarcke/code/python_fx_tools/ in ()

/home/jgarcke/Prog/lib64/python2.6/site-packages/pandas-0.8.1-py2.6-linux-x86_64.egg/pandas/tools/plotting.pyc in plot_series(series, label, kind, use_index, rot, xticks, yticks, xlim, ylim, ax, style, grid, logy, secondary_y, *_kwds)
1292 secondary_y=secondary_y, *_kwds)
1293
-> 1294 plot_obj.generate()
1295 plot_obj.draw()
1296

/home/jgarcke/Prog/lib64/python2.6/site-packages/pandas-0.8.1-py2.6-linux-x86_64.egg/pandas/tools/plotting.pyc in generate(self)
573 self._compute_plot_data()
574 self._setup_subplots()
--> 575 self._make_plot()
576 self._post_plot_logic()
577 self._adorn_subplots()

/home/jgarcke/Prog/lib64/python2.6/site-packages/pandas-0.8.1-py2.6-linux-x86_64.egg/pandas/tools/plotting.pyc in _make_plot(self)
858 if self.use_index and self._use_dynamic_x():
859 data = self._maybe_convert_index(self.data)
--> 860 self._make_ts_plot(data, **self.kwds)
861 else:
862 import matplotlib.pyplot as plt

/home/jgarcke/Prog/lib64/python2.6/site-packages/pandas-0.8.1-py2.6-linux-x86_64.egg/pandas/tools/plotting.pyc in _make_ts_plot(self, data, *_kwargs)
918
919 newlines = tsplot(data, plotf, ax=ax, label=label, style=self.style,
--> 920 *_kwargs)
921 ax.grid(self.grid)
922 lines.append(newlines[0])

/home/jgarcke/Prog/lib64/python2.6/site-packages/pandas-0.8.1-py2.6-linux-x86_64.egg/pandas/tseries/plotting.pyc in tsplot(series, plotf, **kwargs)
80 # set date formatter, locators and rescale limits

 81     format_dateaxis(ax, ax.freq)

---> 82 left, right = _get_xlim(ax.get_lines())
83 ax.set_xlim(left, right)
84

/home/jgarcke/Prog/lib64/python2.6/site-packages/pandas-0.8.1-py2.6-linux-x86_64.egg/pandas/tseries/plotting.pyc in _get_xlim(lines)
210 for l in lines:
211 x = l.get_xdata()
--> 212 left = min(x[0].ordinal, left)
213 right = max(x[-1].ordinal, right)
214 return left, right

AttributeError: 'numpy.int64' object has no attribute 'ordinal'

Contributor

changhiskhan commented Aug 7, 2012

It works on my end. What version of matplotlib and what backend are you using?

jgarcke commented Aug 7, 2012

(on a different machine right now)
Backend should be gtk as listed in the trace:
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py
will check the version of matplotlib

Again, what I find odd, is that it is working fine with 0.8.0, but not with 0.8.1.

jgarcke commented Aug 10, 2012

matplotlib.version
Out[2]: '0.99.1.1'

matplotlib.backends.backend
Out[17]: 'GTKAgg'

Owner

wesm commented Aug 10, 2012

Can you upgrade to at least matplotlib 1.0.1 and let me know if you have any issues? We aren't supporting < 1.0 anymore (0.99.1 is about 3 years old)

@ghost ghost assigned changhiskhan Aug 10, 2012

@jgarcke jgarcke closed this Aug 13, 2012

jgarcke commented Aug 13, 2012

all fine with matplotlib 1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment