Search code examples
pythonwebglplotlyscatter3d

Scatter 3D for Large Data-Set in Plotly


I have a 3D scatter which wanna plot using Plotly in python. The problem is size of the dataframe is too large and I want to use webgl to plot the graph. As I know plotly has go.Scatter3d function to plot scatters. Also, there is a go.Scattergl to plot large datasets. However, U can't find something like go.Scatter3Dgl. What should I do?


Solution

  • I believe 3D scatter plots use webgl by default. If you inspect a scatter_3d you'll find that it is in a class="gl-container". Likewise a regular Scatter is in a class="main-svg and a Scattergl is in a class="gl-container".

    From plotly:

    Note: It is important to note that any figures containing WebGL traces (i.e. of type scattergl, heatmapgl, contourgl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image.