-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
df.plot(ax=ax) AttributeError: 'Axes' object has no attribute 'is_first_col' #11520
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
Comments
@dragoljub Is there a specific reason that you use However, I can't reproduce this issue (using pandas master and matplotlib 1.5). Are you sure the above is a reproducible example? As the place where it fails should only be reached if you have multiple axes (and your example has only one) |
But that said, we maybe shouldn't rely on the assumption it is a Subplot ? |
Couldn't reproduce it either. (pandas master, matplotlib 1.5, OS X). |
@jorisvandenbossche I'm specifically using I am able to reproduction it Jupiter Notebook 4.0 (all Windows X64, builds from Christoph Gohlke's UCI repository). I'll do some more digging to confirm this on other machines. |
@jorisvandenbossche @TomAugspurger I just reproduced it on OSX, Pandas 0.17.0, Matplotlib 1.4.3 Looks like you have to add the df.plot(kind='scatter', ax=ax, x='C', y='D', c=df.C, s=100, linewidth=0, colormap='hsv') ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-76da9d6c62ce> in <module>()
----> 1 df.plot(kind='scatter', ax=ax, x='C', y='D', c=df.C, s=100, linewidth=0, colormap='hsv')
/Users/gagi/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
3665 fontsize=fontsize, colormap=colormap, table=table,
3666 yerr=yerr, xerr=xerr, secondary_y=secondary_y,
-> 3667 sort_columns=sort_columns, **kwds)
3668 __call__.__doc__ = plot_frame.__doc__
3669
/Users/gagi/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
2550 yerr=yerr, xerr=xerr,
2551 secondary_y=secondary_y, sort_columns=sort_columns,
-> 2552 **kwds)
2553
2554
/Users/gagi/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _plot(data, x, y, subplots, ax, kind, **kwds)
2378 plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
2379
-> 2380 plot_obj.generate()
2381 plot_obj.draw()
2382 return plot_obj.result
/Users/gagi/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in generate(self)
990 self._post_plot_logic_common(ax, self.data)
991 self._post_plot_logic(ax, self.data)
--> 992 self._adorn_subplots()
993
994 def _args_adjust(self):
/Users/gagi/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _adorn_subplots(self)
1141 naxes=nrows * ncols, nrows=nrows,
1142 ncols=ncols, sharex=self.sharex,
-> 1143 sharey=self.sharey)
1144
1145 for ax in self.axes:
/Users/gagi/anaconda/lib/python2.7/site-packages/pandas/tools/plotting.pyc in _handle_shared_axes(axarr, nplots, naxes, nrows, ncols, sharex, sharey)
3403 # as we only have labels in teh first column and we always have a subplot there,
3404 # we can skip the layout test
-> 3405 if ax.is_first_col():
3406 continue
3407 if sharey or len(ax.get_shared_y_axes().get_siblings(ax)) > 1:
AttributeError: 'Axes' object has no attribute 'is_first_col' |
Ok that one failed fails for me, thanks. Needing colormap is suggestive. I suspect that we think we're only dealing with one |
Yes, now I can also reproduce it. @dragoljub To get around the bug for now, you can always specify |
@TomAugspurger @jorisvandenbossche Yes, I just noticed by default Pandas adds the colorbar to the plot even though the argument is optional. In my case I do not want the colorbar but would like to customize the colormap. In that case Thanks! |
There seems to be some cases which
|
closed by #11561 |
@jreback |
When attempting to use the Pandas 0.17.0 plot method to target plotting on an external axes: AttributeError: 'Axes' object has no attribute 'is_first_col'.
Pandas: 0.17.0
Numpy: 1.9.2
Matplotlib: 1.5.0
The text was updated successfully, but these errors were encountered: