You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pandas allows declaring a plotting backend different than the default matplotlib one, to which calls to its regular plotting API (e.g. df.plot.line()) will be delegated. hvPlot has supported that for a long time, via pd.options.plotting.backend = 'holoviews/hvplot'. While working on improving the Pandas API guide with @Azaya89, I've started to wonder if hvPlot should steer Pandas users towards that approach or if it should instead steer them towards import hvplot.pandas and the .hvplot namespace.
Pandas added in version 0.25 the possibility to set the plotting backed so that calls to e.g. df.plot.line() are dispatched to the registered backend. It's interesting to note that hvPlot was involved in the discussions about the implementation of this feature pandas-dev/pandas#26747.
How to enable this in hvPlot is currently documented in two places on the website, with pd.options.plotting.backend = 'holoviews':
As a hvPlot user, I'm not sure I've ever used this feature, and if I did I quickly transitioned to directly using the hvplot namespace. There are likely pros and cons for both approaches. I'm wondering if we should orient pandas users (it only applies to this data type) to one of these approaches. Below I tried to see what's the user experience in different environments.
Pandas .plot namespace
Jupyter Lab
Extension:
Loaded on the first .plot call, no visual indication it's loaded (hvPlot doesn't insert a logo).
Warningpre_run_cell IPython hack to reload the extension won't work here if the cell where the extension was loaded is removed or re-executed.
Docstring and signature:
Inherited from Pandas:
VS Code
I have enabled Copilot too. Inherited from Pandas again:
.hvplot namespace
Jupyter Lab
Extension:
Loaded when import hvplot.pandas is executed (not only the first time thanks to the pre_run_cell IPython hack).
Docstring and signature:
Dynamically patched on import (can be improved)
VS Code (python script)
VS Code knows has absolutely no clue about .hvplot :(
VS Code Notebook
TBD
The text was updated successfully, but these errors were encountered:
TL;DR
Pandas allows declaring a plotting backend different than the default matplotlib one, to which calls to its regular plotting API (e.g.
df.plot.line()
) will be delegated. hvPlot has supported that for a long time, viapd.options.plotting.backend = 'holoviews/hvplot'
. While working on improving the Pandas API guide with @Azaya89, I've started to wonder if hvPlot should steer Pandas users towards that approach or if it should instead steer them towardsimport hvplot.pandas
and the.hvplot
namespace.Pandas added in version 0.25 the possibility to set the plotting backed so that calls to e.g.
df.plot.line()
are dispatched to the registered backend. It's interesting to note that hvPlot was involved in the discussions about the implementation of this feature pandas-dev/pandas#26747.How to enable this in hvPlot is currently documented in two places on the website, with
pd.options.plotting.backend = 'holoviews'
:In #347, hvPlot gained partial (see #1483 why partial only) support for
pd.options.plotting.backend = 'hvplot'
.hvPlot is not the only project leveraging this feature:
altair_pandas
project that was never released https://github.com/altair-viz/altair_pandas?I did a quick Github search and, while it doesn't return millions of hits, it still seems to be used quite a bit. People even write articles about that (see https://towardsdatascience.com/the-power-of-pandas-plots-backends-6a08d52071d2/ or https://www.nb-data.com/p/easy-interactive-plot-pandas-plotly-backend-6c9772059515).
As a hvPlot user, I'm not sure I've ever used this feature, and if I did I quickly transitioned to directly using the
hvplot
namespace. There are likely pros and cons for both approaches. I'm wondering if we should orient pandas users (it only applies to this data type) to one of these approaches. Below I tried to see what's the user experience in different environments.Pandas
.plot
namespaceJupyter Lab
Extension:
Loaded on the first
.plot
call, no visual indication it's loaded (hvPlot doesn't insert a logo).Warning
pre_run_cell
IPython hack to reload the extension won't work here if the cell where the extension was loaded is removed or re-executed.Docstring and signature:
Inherited from Pandas:
VS Code
I have enabled Copilot too. Inherited from Pandas again:
.hvplot
namespaceJupyter Lab
Extension:
Loaded when
import hvplot.pandas
is executed (not only the first time thanks to thepre_run_cell
IPython hack).Docstring and signature:
Dynamically patched on import (can be improved)
VS Code (python script)
VS Code knows has absolutely no clue about
.hvplot
:(VS Code Notebook
TBD
The text was updated successfully, but these errors were encountered: