Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: scatter plot with error bars broken on master #8081

Closed
shoyer opened this issue Aug 20, 2014 · 1 comment · Fixed by #8183
Closed

BUG: scatter plot with error bars broken on master #8081

shoyer opened this issue Aug 20, 2014 · 1 comment · Fixed by #8183
Labels
Regression Functionality that used to work in a prior pandas version Visualization plotting
Milestone

Comments

@shoyer
Copy link
Member

shoyer commented Aug 20, 2014

This example works on 0.14.1 but not master:

%matplotlib inline
import numpy as np
import pandas as pd
np.random.seed(12345)
df = pd.DataFrame(np.random.rand(10, 5), columns=['a', 'b', 'c', 'd', 'e'])
df.plot(x='a', y='b', xerr='c', yerr='d', kind='scatter')

I get:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-1-38e437a109be> in <module>()
      4 np.random.seed(12345)
      5 df = pd.DataFrame(np.random.rand(10, 5), columns=['a', 'b', 'c', 'd', 'e'])
----> 6 df.plot(x='a', y='b', xerr='c', yerr='d', kind='scatter')

/Users/shoyer/dev/pandas/pandas/tools/plotting.pyc in plot_frame(frame, x, y, subplots, sharex, sharey, use_index, figsize, grid, legend, rot, ax, style, title, xlim, ylim, logx, logy, xticks, yticks, kind, sort_columns, fontsize, secondary_y, layout, **kwds)
   2223                              secondary_y=secondary_y, layout=layout, **kwds)
   2224 
-> 2225     plot_obj.generate()
   2226     plot_obj.draw()
   2227     return plot_obj.result

/Users/shoyer/dev/pandas/pandas/tools/plotting.pyc in generate(self)
    911         self._compute_plot_data()
    912         self._setup_subplots()
--> 913         self._make_plot()
    914         self._add_table()
    915         self._make_legend()

/Users/shoyer/dev/pandas/pandas/tools/plotting.pyc in _make_plot(self)
   1402 
   1403         errors_x = self._get_errorbars(label=x, index=0, yerr=False)
-> 1404         errors_y = self._get_errorbars(label=y, index=1, xerr=False)
   1405         if len(errors_x) > 0 or len(errors_y) > 0:
   1406             err_kwds = dict(errors_x, **errors_y)

/Users/shoyer/dev/pandas/pandas/tools/plotting.pyc in _get_errorbars(self, label, index, xerr, yerr)
   1362                         err = None
   1363                 elif index is not None and err is not None:
-> 1364                     err = err[index]
   1365 
   1366                 if err is not None:

IndexError: index 1 is out of bounds for axis 0 with size 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Visualization plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants