0

I have four sets of contour data, and I'd like to plot them on the same graph, in the four quadrants. I'd also like the contours to 'reflect' in the same x- and y-axis, i.e. the center of the plot is the origin for all four plots.

I have the following code::

fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2,2, sharex=True, sharey=True)

fig.subplots_adjust(hspace=0)
fig.subplots_adjust(wspace=0)

xmin = -1.1
xmax =  2.1
ymin = -1.1
ymax =  2.1

## Top left quadrant
# set_xlim(left, right)
ax1.set_xlim(xmax, xmin)
ax1.set_ylim(ymin, ymax)
CS1 = ax1.contour(X_red, Y_red, Z_red, colors='k', levels=levels_red)
ax1.clabel(CS1, inline=1, fontsize=10)

## Top right quadrant
ax2.set_xlim(xmin, xmax)
ax2.set_ylim(ymin, ymax)
CS2 = ax2.contour(X_blue, Y_blue, Z_blue, colors='r')
ax2.clabel(CS2, inline=1, fontsize=10)

## Bottom left quadrant
CS3 = ax3.contour(X_Sp, Y_Sp, Z_Sp, colors='b')
ax3.clabel(CS3, inline=1, fontsize=10)
ax3.set_xlim( xmax, xmin)
ax3.set_ylim( ymax, ymin)

## Bottom, right quadrant
ax4.set_xlim( xmin,xmax)
ax4.set_ylim( ymax, ymin)
CS4 = ax4.contour(X_ET, Y_ET, Z_ET, colors='g')
ax4.clabel(CS4, inline=1, fontsize=10)

plt.show()

but this is putting the all four contour plots in the top left of their respective quadrantes. Thoughts??!!

npross
  • 1,756
  • 6
  • 19
  • 38

0 Answers0