Skip to content

Commit 0ea226f

Browse files
committed
removed colorbars from _handle_shared_axes when called by scatterplot and hexbin
1 parent e2abff6 commit 0ea226f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/plotting/_core.py

-3
Original file line numberDiff line numberDiff line change
@@ -869,16 +869,13 @@ def _make_plot(self):
869869
label = None
870870
scatter = ax.scatter(data[x].values, data[y].values, c=c_values,
871871
label=label, cmap=cmap, **self.kwds)
872-
873872
if cb:
874873
ax._pandas_colorbar_axes = True
875874
img = ax.collections[0]
876875
kws = dict(ax=ax)
877876
if self.mpl_ge_1_3_1():
878877
kws['label'] = c if c_is_column else ''
879878
self.fig.colorbar(img, **kws)
880-
881-
882879

883880
if label is not None:
884881
self._add_legend_handle(scatter, label)

pandas/plotting/_tools.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,19 @@ def _remove_labels_from_axis(axis):
298298

299299
def _handle_shared_axes(axarr, nplots, naxes, nrows, ncols, sharex, sharey):
300300
if nplots > 1:
301+
301302
if nrows > 1:
302303
try:
303304
# first find out the ax layout,
304305
# so that we can correctly handle 'gaps"
305306
layout = np.zeros((nrows + 1, ncols + 1), dtype=np.bool)
306307
for ax in axarr:
307308
layout[ax.rowNum, ax.colNum] = ax.get_visible()
309+
308310
for ax in axarr:
309311
# only the last row of subplots should get x labels -> all
310312
# other off layout handles the case that the subplot is
311-
# the last in the column, because below is no subplot/gap.
313+
# the last in the column, because below is no subplot/gap.
312314
if not layout[ax.rowNum + 1, ax.colNum] or getattr(ax, '_pandas_colorbar_axes', False):
313315
continue
314316
if sharex or len(ax.get_shared_x_axes()

0 commit comments

Comments
 (0)