<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Jonathan, </div><div class=""><br class=""></div>If you are setting the aspect ratio of your subplots, space can be missing on the RHS if the setting the aspect ratio causes the subplots to shrink horizontally. The “solution†to this is to make your *figure* more tall and less wide until the aspect ratio shrink happens in the vertical instead of the horizontal, or don’t set the aspect ratio. Its pretty hard for matplotlib to do this automatically and still do the usual layout for axes that do not have their aspect ratio set, the desired behaviour of which is to make the axes as big as possible.<div class=""><br class=""></div><div class="">I’m working on a PR to make colorbars automatically match the height of the shown axes, rather than its place holder, but thats non-trivial. </div><div class=""><br class=""></div><div class="">Cheers, Jody<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 14 May 2019, at 08:43, Slavin, Jonathan <<a href="mailto:jslavin@cfa.harvard.edu" class="">jslavin@cfa.harvard.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Hi,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">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.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">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.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Jon</div><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><img src="https://lh6.googleusercontent.com/mJuf9zI6QC5w6HPVCinnLSkpp-RgufOfl7nw1E_aghDflNhusoRbZTuP_0x-RkECQRhIfvPxGMe6zSt6chyXZ7D5DdqtkZPp0q-TE8itKny8VWObWAiZ1aurYWDO0CtZgvJEXfzu" width="350" height="2" style="font-size:12.6667px;font-family:Arial;white-space:pre-wrap;border:none" class=""></div><div dir="ltr" class="">Jonathan D. Slavin</div><div dir="ltr" class="">Astrophysicist - High Energy Astrophysics Division</div><div dir="ltr" class="">Center for Astrophysics | Harvard & Smithsonian</div><div dir="ltr" class="">Office: (617) 496-7981 | Cell: (781) 363-0035<br class="">60 Garden Street | MS 83 | Cambridge, MA 02138</div></div><div dir="ltr" class=""><span class=""><div style="line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh6.googleusercontent.com/mJuf9zI6QC5w6HPVCinnLSkpp-RgufOfl7nw1E_aghDflNhusoRbZTuP_0x-RkECQRhIfvPxGMe6zSt6chyXZ7D5DdqtkZPp0q-TE8itKny8VWObWAiZ1aurYWDO0CtZgvJEXfzu" width="350" height="2" style="border:none" class=""></span><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class=""><br class=""></span></div></span></div></div></div></div></div></div></div></div>
_______________________________________________<br class="">Matplotlib-users mailing list<br class=""><a href="mailto:Matplotlib-users@python.org" class="">Matplotlib-users@python.org</a><br class="">https://mail.python.org/mailman/listinfo/matplotlib-users<br class=""></div></blockquote></div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Sans Typewriter'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;"><div style="word-wrap: break-word;" class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Sans Typewriter'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;"><div class="">--</div><div class="">Jody Klymak </div><div class=""><a href="http://web.uvic.ca/~jklymak/" class="">http://web.uvic.ca/~jklymak/</a></div><div class=""><br class="khtml-block-placeholder"></div><div class=""><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></div></span><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>