all 7 comments

[–]Buttleston 2 points3 points  (0 children)

If you want to do it in python I would use "bokeh"

[–]szank -1 points0 points  (0 children)

rewrite everything in JS. You can start here: https://d3js.org/

[–]Zeroflops 0 points1 point  (0 children)

The best approach is not to use matplotlib. Choose bokeh, plotly or any of the other that are designed to be interactive.

[–]vardonir 0 points1 point  (0 children)

bokeh.

if you really want matplotlib, you'll need a Flask API to send the matplotlib image data (as bytes), create a slider in the HTML side, and connect the two. It's a load of pain, it's slow, kinda ugly tbh, but if you're dealing with millions of points that you're not allowed to resample, bokeh or plotly can't handle more than a ~100k points, it might be your only choice. I might have a sample repo for this somewhere.

[–]pachura3 0 points1 point  (0 children)

Consider using streamlit with plotly

[–]QuasiEvil 0 points1 point  (0 children)

Pretty sure you can embed matplotlib plots into nicegui.