-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix calling special Pandas plotting methods with the hvplot backend #1491
Conversation
@@ -45,6 +45,7 @@ dependencies = [ | |||
|
|||
[project.entry-points."pandas_plotting_backends"] | |||
holoviews = "hvplot:plotting" | |||
hvplot = "hvplot:plotting" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix.
There are multiple ways a Some data import numpy as np
import pandas as pd
np.random.seed(123456)
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))
import hvplot.pandas
ts.hvplot.hist()
pd.options.plotting.backend = 'hvplot'
ts.hist()
2b. Prepending with pd.options.plotting.backend = 'hvplot'
ts.plot.hist() |
Did you re-install |
Thank you. I didn't know that. |
Relieved to see it works as it's what is tested with https://github.com/holoviz/hvplot/pull/1491/files#diff-8d066bf9f51083145a38e3d3346ad7f86ac33f994b9008217f2cc92a91aa0b05R72-R77 |
Fixes #1483
When a plotting backend is configured on pandas via e.g.
pd.options.plotting.backend = '<backend>'
, Pandas has two ways to use it:holoviews = "hvplot:plotting"
registersholoviews
as an entry point pointing to thehvplot.plotting
module).In both cases, the only check Pandas performs is to verify that the backend has a
plot
attribute.#347 exposed the
plot
function fromhvplot.plotting
in the top-level module, allowing users to register the backend withpd.options.plotting.backend = 'hvplot'
(leveraging 2/). However, that is not enough to give users access to the special plot methods Pandas expects likeboxplot
orhist
.This PR fixes that by adding another
hvplot
entry point.