I've calculated some values representing a potential as a function of x,y using relaxation method. And I want to display a contour plot with colors (not lines) but, the examples at matplotlib are all fancy 3d plots. I have a ufinal
object which is a 2 dimensional numpy array. I did see some nice answers with very nice plots here on SO but I wasn't able to use them properly with my data. I was able to plot a 3d plot using the examples but that's not what I need:
fig = plt.figure()
ax = fig.gca(projection='3d')
X,Y=meshgrid(x,y)
surf=ax.plot_surface(X,Y,ufinal,rstride=1,cstride=1,cmap=cm.jet,linewidth=0.1)
fig.colorbar(surf,shrink=0.5,aspect=5)
As suggested I've tried using the contourf example like so:
CS = plt.contourf(X, Y, ufinal,cmap=cm.jet)
plt.clabel(CS, inline=1, fontsize=10)
plt.title('Simplest default with labels')