I’m brand new to Plotly, but want to try it out for 3D interactive plotting because I hear it’s way faster than matplotlib for that use case. I use Jupyter notebooks and so far have only used matplotlib through ipympl.
What I want to do is to plot a set of connected line segments in 3D (or a “forest” of such connected components). The thing that differentiates this from a typical line graph is that the network is arbitrarily branched, i.e. there is not some linear ordering of the points such that point n is always connected only to points n-1 and n+1. Think of it as a 3D graph (the graph theory kind).
When using matplotlib I set up a set of 3D axes, then do a bunch of ax.plot([x1,x2],[y1,y2],[z1,z2]) calls for each segment. There may be hundreds of these, each with its own color computed programmatically on the fly, and I plot them as my code generates them. The resulting plots are very slow to rotate interactively, and use the entirety of the notebook’s resources to do so, which seems from my research to be par for the course with matplotlib.
I’m trying to “port” this to Plotly to improve performance. However, looking at all the examples on the Plotly website, I get the strong impression that Plotly really wants a whole figure “batched” into a single, highly vectorized data structure that can be passed to it in one go. So I suspect that for my case it wants something like an OpenGL vertex buffer/index buffer pair, in other words all vertices placed with their X coordinates in one big array, and same for Y and Z, and then a list of all the edges somehow expressed as pairs of indices into these big arrays.
However, I can’t find an example of the syntax for this. The example line graphs are of the kind where there is one single line snaking through the points in a well-defined ordering, or there are scatter plots that are JUST a cloud of vertices with no edges.
