0

I'm attempting to make a 3D surface plot of a spectrogram, but I want to limit the axes to a certain frequency and time range. I've tried the following:

fig = plt.figure(figsize=(1,1))
ax = mplot3d.axes3d.Axes3D(fig,rect=(0,0,20,5),azim=-90,elev=10)
plot = ax.plot_surface(x,y,z,norm=norm,vmin=vmin,vmax=vmax,cmap=cmap)
ax.axes.set_ylim3d(bottom=0, top=200) 
ax.axes.set_xlim3d(left=-5, right=40) 
fig.colorbar(plot)
plt.show()

as well as xlim()/ylim(), and set_ylim()/set_xlim(). For some reason, when I try to limit the axes, the graph spills over the edge like so.

The graph without axis limits for reference.

How do I avoid this?

Petra
  • 195
  • 1
  • 1
  • 10

0 Answers0