3D Surface plot and Scatter plot in Flask - Bokeh - python

Can we combine two 3D plots - Scatter 3D and Surface 3D in bokeh which share the same columnDataSource on the same 3D axes?
My objective is to show some 3D moving points (like a path which starts from one point and ends at another point) on a 3D static Surface plot in Flask using bokeh. I need to plot something like this https://github.com/bokeh/bokeh/blob/master/examples/app/surface3d but I do not want to move the whole surface, I just want to move few points on this surface(like a path traced)
Any help or suggestion would be greatly appreciated. Thanks in Advance.

Related

Plot a Colored Contour Map on a 3D surface in Matplotlib

I am currently working on a 3D simulation data. I have a 3D surface, for simplicity, lets say, I have a hemispherical surface. So naturally, I have all the (x,y,z) coordinates that make up the surface. Now I also have a fourth array having the values of some variable (say Pressure for example) at all the (x,y,z) locations that make up the hemispherical surface. My aim is to plot the hemispherical surface and the surface should be coloured according to the fourth array (i.e according to the value of Pressure at that surface).
I have tried pyplot.scatter function from matplotlib, where i use pyplot.scatter(x,y,z, c= Pressure_array) but it leaves me with an artefact like the one shown below (image shows a zoomed in portion of the entire plot)
Notice the fringe like circular pattern. This arises because a Cartesian grid is sampled by a spherical surface and the same is plotted by the scatter points. This pattern remains even upon interpolation of the color values
I am looking for an alternative to the scatter plot method where the surface will be smoother and the circular fringes will be absent. I am aware that matplotlib has surface plots, but i am unable to use it because there, the 'z' coordinate sets both, the height of the plot in 3D and essentially the Color of the surface as well.
Any alternative to scatter plot or surface plot, or a way to get the same domne with the surface plot function in matplotlib will be much appreciated.

Way to toggle Mesh 3d plots in plotly python

I'm trying to make a mesh 3d plot in python using plotly. The plot is working fine but as I have read Mesh 3d plots doesn't have legend support. So there's no way I'm able to toggle the mesh 3d plot.
Is there any way I can make this functionality of toggling the mesh 3d plot in python?

How to draw this kind of 3D axes with Plotly in Python?

Plotly is an excellent data visualization solution. But I don't like the default style of 3D axes. I want to know, how to draw this kind of 3D axes with Plotly in Python?

Vector axes but raster points for Matplotlib scatter plots

I have a Matplotlib scatter plot with 10,000+ points that I plan to insert as a figure in a LaTeX document for publication.
I would like the plot points to be raster graphics (e.g. PNG) because vector graphics with that many points often causes problems for PDF readers. I would like the ticks and axes labels to be vector graphics so I don't have to worry about resolution issues for the text and lines.
Is there a simple way to get matplotlib to make parts of the plot raster graphics while keeping the axes/ticks vector graphics?
My best guess so far is to do some sort of pre-render to PNG then imshow the resulting image with appropriate axes bounds before saving to PDF.
Add rasterized=True to the call to plt.scatter
See the docs here
You can control the dpi of the rasterized parts of the figure by setting dpi=300 (for example) in the call to plt.figure

Animate 3D plotting data using Mayavi in Python

I have an array of points (x,y,z) that I would like to animate in 3D using Mayavi (Python). I am currently using a Plot3D command to plot all of the points simultaneously (modeling the movement of a particle), but would love some help on the animation.
Thanks!
Matplotlib offers a lot of possibilities for animation. Have a look at the specific routines for animation. In particular, there's a specific example for 3D plotting.
There are quite a few tutorials on the 'web. Eg. Matplotlib Animation Tutorial and Animated 3-D Plots in Python

Categories