rougier / matplotlib-tutorial

Matplotlib tutorial for beginner
2.96k stars 808 forks source link

How to fix sub_plots and colorbar size issue for geographic map #26

Closed HARSHBARDHANK94 closed 2 years ago

HARSHBARDHANK94 commented 2 years ago

Hi, I am referring the same query from stackoverflow (https://stackoverflow.com/questions/72149875/how-to-deal-with-the-colorbar-axis-space-in-matplotlib-subplots), that I have raised there. I have plotted multiple sub_plots (7rows * 4columns) and at the end of each row I want to put colorbar. but my last column axes size compromised with colorbar axis. Any help from this matplotlib-tutorial community!

rougier commented 2 years ago

You can use a Gridspect and specify realtive width. Just add a fifth column for colorbars with smaller relative width.