I'm trying to get two subplots of different kind. The first should show an image (colormap) of the data, the second a surface plot of the same data. Independently, both plots work fine, but if i want to combine them into one figure, it fails with the error: AttributeError: 'AxesSubplot' object has no attribute 'plot_surface'
Here is my code
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=(20, 6))
#fig, ax = plt.subplots(nrows=1, ncols=2, subplot_kw={'projection': '3d'}, figsize=(20, 6))
surf1 = ax1.imshow(I[:,:,250], cmap=plt.cm.YlGnBu_r)
surf2 = ax2.plot_surface(X[:,:,0], Y[:,:,0], loaded_profile, cmap=plt.cm.YlGnBu_r,linewidth=0, antialiased=False)
ax[0].set_xlabel(r'$\phi_\mathrm{real}$')
show()
I'm using jupyter notebook and python 3.6 Where is my error?