How can I combine a 3D scatter plot with a 3D surface plot while keeping the surface plot transparent so that I can still see all the points?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
To combine various types of plots in the same graph you should use the function
plt.hold(True).
The following code plots a 3D scatter plot with a 3D surface plot:
result:
http://s9.postimage.org/ge0wb8kof/3d_scatter_surface_plt.gif
you can see some other examples with 3d plots here:
http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html
I've changed the colours of the surface plot from the default to a colormap "hot" in order to distinguish the colours of the two plots - now, it's seen that the surface plot overrides the scatter plot, independently of the order...
EDIT: To fix that issue, it should be used transparency in the colormap of the surface plot; adding the code in: Transparent colormap and changing the line:
to
we get:
http://s16.postimage.org/5qiqn0p5h/3d_scatter_surface_plt_transparent.gif
Using siluaty's example; instead of using transparency through the cmap=theCM command, you can adjust the alpha value. This may get you what you want?