0

How do I make two subplots share the same colorbar? As you can see from my attachment the colorbar is on different scales, which makes comparison difficult. Does anybody have any advice?

f,ax=plt.subplots(1,2, figsize=(10,10))

lsoas_lpool.plot(column='Value',ax=ax[0], cmap='Reds', linewidth=0, legend=True)
lsoas_lpool.plot(column='AGG_VI',ax=ax[1], cmap='Reds', linewidth=0, legend=True)

plt.show()

enter image description here

Sam Comber
  • 1,237
  • 1
  • 15
  • 35
  • Does this answer your question? [Matplotlib 2 Subplots, 1 Colorbar](https://stackoverflow.com/questions/13784201/matplotlib-2-subplots-1-colorbar) – Lescurel Mar 24 '20 at 15:31
  • 1
    You need to use the same `vmin=` and `vmax=` for both plots for them to use the same ranges for the colors. Something like `vmin=min(min(lsoas_lpool[''Value'']), min(lsoas_lpool[''AGG_VI'']))`. Similar for `vmax`. And then for boh plots: `lsoas_lpool.plot(...., vmin=vmin, vmax=vmax)` – JohanC Mar 24 '20 at 15:44
  • @JohanC Yes! Exactly what I needed – Sam Comber Mar 24 '20 at 15:46

0 Answers0