[Matplotlib-users] plot with multiple images and colorbar

Slavin, Jonathan jslavin at cfa.harvard.edu
Tue May 14 11:43:44 EDT 2019


I've been working on producing a figure using results of a hydro simulation
at multiple times. Because the scale of the region of interest changes over
time, I want the size of the axes to change. My goal is to make a figure
with results of four timesteps, so four images in a row, with each scaled
appropriately and with a colorbar on the right. I tried to use ImageGrid,
but that doesn't like having different axis scales for the plots - at least
it seems to always scale the y axis the same despite my best efforts -
though it does a nice job of locating the colorbar.

So I went back to subplots, but in that case the colorbar isn't the right
size, at least without tweaking the shrink parameter. Also, for some reason
there is a lot of space on the right of the plot even when I use
subplots_adjust to set right=0.99. There are many ways to place colorbars,
I know, but it would seem that my case would not be so unusual that I
should need such complex methods to do what I want. Maybe I'm missing
something. Any advice would be appreciated.


Jonathan D. Slavin
Astrophysicist - High Energy Astrophysics Division
Center for Astrophysics | Harvard & Smithsonian
Office: (617) 496-7981 | Cell: (781) 363-0035
60 Garden Street | MS 83 | Cambridge, MA 02138
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20190514/014889f2/attachment.html>

More information about the Matplotlib-users mailing list