Can't mix bare matplotlib and holoviews on same Jupyter notebook env

After plotting with hvplot on a Jupyter notebook and going back to standard .plot methods from pandas or xarray, either hvplot stop working for subsequent plots (like .hvplot.hist) or the bare matplotlib wrappers stop working, not showing even with plt.show

hvplot likely sets matplotlib.use(“Agg”) which makes the plots hidden.

Is there a reason why you want to go back to the standard plot methods?

You can probably do pn.panel(mpl_obj) to make it show up.

I use hvplot for interactive data analysis and then the standard methods for static figures to be saved as png, svg (publication quality). So I need both to work on the same environment (or learn how to use hv.save properly).
As I said, the opposite also happens, calling .plot or setting pandas backend to matplolib again makes hvplot methods not respond to changes on panel.widgets anymore.

This should not be the case. We’ll have to investigate exactly what is happening here.

1 Like