In one jupyter notebook, after I use holowviews plot the figure, how can I back to use the geopandas.GeoDataFrame.plot?

As the title says, after using the holoviews for plotting, I want direct use the geopanda.GeoDataFrame.plot in a same jupyter notebook, how can I stop rendering with holoviews?

Are you using pd.set_option("plotting.backend", "hvplot")? If so, what if you change it to pd.set_option("plotting.backend", None)

If not, can you share some code?

The code was like this:

import numpy as np
import pandas as pd
import holoviews as hv
from holoviews import opts
hv.extension("bokeh", "matplotlib")

data = np.random.randint(0, 100, 300)
df = pd.DataFrame(data.reshape(100,3), columns=list("ABC"))
# plotting with holoviews
hv.Points(df, ["A","B"], "C")
# change back to use the pandas.DataFrame.plot
hv.output(backend="matplotlib")
df.plot.scatter(x="A", y="B", c="C")

After using the Holoviews plotting function to explore the data, How to switch back to using the Pandas DataFrame.plot function directly.

What if you do this:

import numpy as np
import pandas as pd
import holoviews as hv
from holoviews import opts
hv.extension("bokeh")

data = np.random.randint(0, 100, 300)
df = pd.DataFrame(data.reshape(100,3), columns=list("ABC"))
# plotting with holoviews
hv.Points(df, ["A","B"], "C")
# change back to use the pandas.DataFrame.plot
df.plot.scatter(x="A", y="B", c="C")

Thanks, it works when the hv.extention just only uses the bokeh backend.

1 Like