When I tried to draw an arrow, the pointing end got blocked by other axes, do you know how to make that part visible?
It'll be great if you could edit on top of the sample code I have here.
from matplotlib.patches import ConnectionPatch
import matplotlib.pyplot as plt
import numpy as np
grid_data = np.array([[[-0.1779874 , -0.90335705, -0.31157705, 0.77770067],
[ 0.93698288, 0.79215241, 0.10155888, 0.96101718],
[ 0.72994894, -0.83939131, 0.24713443, 0.74839211],
[ 0.10039462, -0.95778299, 0.43554077, 0.61927077]],
[[ 0.52294259, -0.0247383 , 0.23717517, -0.0857769 ],
[-0.43539246, 0.28503173, -0.39443502, -0.1478289 ],
[-0.2327904 , -0.08339054, 0.33072907, 0.74634504],
[-0.524284 , -0.72919194, -0.61543159, 0.17086563]]])
fig, axes = plt.subplots(nrows = 2, ncols = 2, figsize = (2.6, 2.8))
for i in range(2):
c = axes[0,i].pcolormesh(grid_data[i], cmap = 'RdBu_r', vmin = -1., vmax = 1.)
xyA = (0.5,0)
xyB = (0.5,.5)
coordsA = "axes fraction"
coordsB = "axes fraction"
con = ConnectionPatch(xyA = xyA, xyB = xyB, coordsA=coordsA, coordsB=coordsB,
axesA=axes[0,0], axesB=axes[0,1],
arrowstyle="->", shrinkB=5, linewidth = 5, edgecolor='b', clip_on=False)
axes[0,0].add_artist(con)
cb_ax = fig.add_axes([0.91, 0.13, 0.01, 0.75])
fig.colorbar(c, cax = cb_ax)
plt.draw()
plt.show()