If I have the following code:
import seaborn
import matplotlib.pyplot as plt
flights = sns.load_dataset("flights")
flights = flights.pivot("month", "year", "passengers")
f,(ax1,ax2,ax3) = plt.subplots(1,3,sharey=True)
g1 = sns.heatmap(flights,cmap="YlGnBu",cbar=False,ax=ax1)
g1.set_ylabel('')
g1.set_xlabel('')
g2 = sns.heatmap(flights,cmap="YlGnBu",cbar=False,ax=ax2)
g2.set_ylabel('')
g2.set_xlabel('')
g3 = sns.heatmap(flights,cmap="YlGnBu",ax=ax3)
g3.set_ylabel('')
g3.set_xlabel('')
How can I adjust the subplots so that the g3 axis is the same width as the g1,g2 axis. Since I have not added the color bar to the first two axis', seaborn shrinks the third axis down to make the entire figure consistent. This is understandable.
I want this:
Perhaps I need to make a 4 panel subplot with the fourth panel only containing the colorbar?