xlabel disappears in scatter plots with subplots and colorbar · Issue #20455 · pandas-dev/pandas (original) (raw)
This is related to this PR #20446. Separating the subplot and single plots into two issues.
def make_multiplots(numrows=2,numcols=2,sharey=True,sharex=True,PATCH_MODE_FLAG = True, is_scatter = True):
fig, axes = pl.subplots(numrows,numcols,sharey=sharey,sharex=sharex )
for i in range(axes.shape[0]):
for j in range(axes.shape[1]):
random_array = np.random.random((1000,3))
df = pd.DataFrame(random_array,columns=['A label','B label','C label'])
if is_scatter:
df.plot.scatter('A label','B label',c='C label', PATCH_MODE_FLAG = PATCH_MODE_FLAG,ax=axes[i,j]);
else:
df.plot.hexbin('A label','B label',gridsize=20, PATCH_MODE_FLAG = PATCH_MODE_FLAG,ax=axes[i,j]);
make_multiplots(numrows=2,numcols=2,sharey=True, sharex=True, PATCH_MODE_FLAG = False, is_scatter=True);pl.suptitle('pandas current version');
make_multiplots(numrows=2,numcols=2,sharey=True, sharex=True, PATCH_MODE_FLAG = True, is_scatter=True);pl.suptitle('patch fixing x-axis');
make_multiplots(numrows=2,numcols=2,sharey=True, sharex=True, PATCH_MODE_FLAG = False, is_scatter=False);pl.suptitle('pandas current version');
make_multiplots(numrows=2,numcols=2,sharey=True, sharex=True, PATCH_MODE_FLAG = True, is_scatter=False);pl.suptitle('patch fixing x-axis');