I have two independent datasets, z_p and z_g here, and I would like to put two tricontourf() instances on the same axis, each instance corresponding to a contour of one dataset. Below is a pseudo-code of what I do:
cmap_p = plt.get_cmap('Reds')
norm_p = BoundaryNorm(levels, ncolors=cmap_p.N, clip=True)
cmap_g = plt.get_cmap('Blues')
norm_g = BoundaryNorm(levels, ncolors=cmap_g.N, clip=True)
lev = range(lower_level, upper_level+1)
obj_g = ax.tricontourf(x, y, z_g, cmap=cmap_g, norm=norm_g,
levels=lev, extent=[x0, y0, x1, y1], zorder=2)
obj_p = ax.tricontourf(x, y, z_p, cmap=cmap_p, norm=norm_p,
levels=lev, extent=[x0, y0, x1, y1], zorder=3)
The output figure is attached below. Clearly, only the second call to tricontourf() has effectively worked, since there is a patch on the left of the figure in red. If I comment out the call to get obj_p, then I get a blue patch on the right side of the figure in blue color. However, the two subsequent calls to tricontourf() do not work simultaneously.
I would be grateful if someone would tell me how to show both contours on the same axis?