So, I need to plot some data in a nice 3D plot. After using a few libraries for 3D plotting I get the best plot for my data using plotly, and that looks like this
This is exactly the plot I need. But the free version of plotly only let you save the plot in png or jpeg and doesn't export to vector graphics formats like svg or eps that I need.
So, I moved to another popular library i.e. python matplotlib. Using this script,
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# some calculations here
ax.plot_surface(x, y, z, cmap='coolwarm', rstride=5,
cstride=10, vmin=-1.65447, vmax=-1.4)
ax.set_zlim(-1.65447, -1.4)
plt.show()
Now, this looks totally messed up and ugly. The biggest problem here is that the Z axis doesn't get cut at -1.4. I don't have deeper knowledge about matplotlib, so I don't know how to fix this. So, how to make the plot better and more like the nice plolty plot I want.