Here is an example that shows a colorbar for each subplot:
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.random((10,10,)))
fig,axn = plt.subplots(2, 2, sharex=True, sharey=True)
for ax in axn.flat:
sns.heatmap(df, ax=ax)
How can I remove the colorbars for each subplot? I'd like to have only one colorbar that is either vertically or horizontally oriented. I know I have access to each colorbar axes via fig.get_axes()[:-4]
, but how can I remove it from them entirely from the plot? I don't think there is an option to opt out of drawing the colorbar when heatmap is called.