Add bokeh render to enable visualization being interactive

Hi,
I want to add bokeh render to support visualizing plot interactively. Do you guys have any suggestions on implementation or reference material?
From what i see, i need to derive another class like MPRenderer here .

Best regards,
Michael

If you want interactive matplotlib plots, you just need to change the matplotlib backend in your script like described here Usage — Matplotlib 2.0.2 documentation

import maplotlib
matplotlib.use("tkAgg") # or any other interactive backend

If you want to use another plotting library, you need to implement the whole renderer, i.e. implement all abstract functions of the base renderer.

Thank you. I test the backend you mentioned and some other methods, like %matplotlib inline %matplotlib notebook %matplotlib widget. With some modifications, zoom on scroll event and pan can be enabled for the plot. This totally meets my requirements for the plot to be interactive.

But i meet another issue, that is it’s too slow, not smooth. Anyway, it meets my requirements, I’ll choose this way. Thanks, bro.

That’s because matplotlib is not built for real-time applications. If you want to use bokeh, you might want to write a converter that takes matplotlib plots created using the existing MPRenderer and visualizes them with bokeh e.g. for zooming, translating etc. As soon as you dynamically trigger new rendering from the backend, e.g. when animating scenarios over several time steps, it probably won’t surpass the current implementation, because to my knowledge bokeh is running python in its backend as well.