Hi there, 

When you initialize a matplotlib AxesGrid object with  `share_all=True`, all of 
the axes will be linked. So calling `flip_vertical()` will flip all of the 
linked vertical axes. When `share_all=False`, then y axes in each row will be 
linked. If you put your plots in separate rows with `share_all=False` then 
`flip_vertical` will behave as expected. e.g.,:

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
import yt

ds = yt.load_sample("IsolatedGalaxy")  

fig = plt.figure()
grid = AxesGrid(
    fig,
    (0.075, 0.075, 0.85, 0.85),
    nrows_ncols=(2, 1),
    axes_pad=1.0,
    label_mode="all",
    share_all=False,
    cbar_location="right",
    cbar_mode="edge",
    cbar_size="5%",
    cbar_pad="0%",
)

for i in range(2):
    p = yt.SlicePlot(ds, 'x', 'density')
    p.zoom(40)    
    if i == 1: 
        p.flip_vertical()
        
    plot = p.plots['density']
    plot.figure = fig
    plot.axes = grid[i].axes
    plot.cax = grid.cbar_axes[i]    
    p.render()

plt.savefig("multiplot_with_flip.png")
_______________________________________________
yt-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: [email protected]

Reply via email to