0

Let us assume I generate 60 numpy 2d arrays of size (n,3) each second (500 < n < 5000) and I want to live plot each of these arrays, clear them from the plot and plot the next 2d array. I also want the plotting to be independent of mouse interactions and when I interact, the plotting shouldn't be interrupted. How do you achieve this, & What is the best framework for the same in python?

I'm willing to make compromises on the interactivity of the plot/visualization but at the very least I want to set the viewing angle at the start of the plot and not change it.

I've already tried achieving this using 2 different libraries, pptk and matplotlib but I'm not happy with the results of either of those.

In case of pptk, my plot crashes after 30-40 plot updates and after each plot update the viewing angle is reset to some default value. The plot looks exactly like what I want it to but I'm unable to find a fix for the crash or a way to set viewing angle. Below is a plot of a single 2d array using pptk

PPTK output

In case of matplotlib, I'm using scatter plots. I'm able to set the axes limits in advance (I can also set azimuth and elevation if needed) and plot keeps updating but the plot is not detailed and the plot updates aren't smooth.

Matplotlib output

I would be happy if the plot updates are smooth and if they look like the pptk plots. Any help is appreciated. I would be very grateful at least if I'm pointed towards the right direction to live plot a set 3d points.

Sample 2d array:
[[1,2,3]
[4,5,6]
...
[7,8,9]]

Edit - Scatter plots are being plotted in case of matplotlib.

theY2Kbug
  • 29
  • 4
  • Related: https://stackoverflow.com/q/62912397/1025391 – moooeeeep May 30 '22 at 10:11
  • @moooeeeep I believe I cannot use this example because the point clouds are predetermined but in my case if generate a 2d array, I need to immediately plot it and update the plot with next 2d array. Also in the o3d documentation for non-blocking visualization, they've mentioned _"This is not optimal when geometry is updated and needs to be visualized without closing the window."_ Nevertheless, thank you – theY2Kbug May 30 '22 at 10:36
  • Ah, too bad. Did you check the interactive visualization though? – moooeeeep May 31 '22 at 06:40

0 Answers0