Skip to content
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

DOC: Plotting Backend Documentation Incorrect #58251

Open
1 task done
WillAyd opened this issue Apr 13, 2024 · 6 comments
Open
1 task done

DOC: Plotting Backend Documentation Incorrect #58251

WillAyd opened this issue Apr 13, 2024 · 6 comments
Labels
Docs Needs Discussion Requires discussion from core team before further action Visualization plotting

Comments

@WillAyd
Copy link
Member

WillAyd commented Apr 13, 2024

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html#plotting-backends

Documentation problem

The plotting backend documentation reads:

Some libraries implementing a backend for pandas are listed on the ecosystem page.

However, not every library on the ecosystem page implements the pandas plotting backend:

>>> df.plot(backend="seaborn")
ValueError: Could not find plotting backend 'seaborn'. Ensure that you've installed the package providing the 'seaborn' entrypoint, or that the package has a top-level `.plot` method.
>>> df.plot(backend="pygwalker")
ValueError: Could not find plotting backend 'pygwalker'. Ensure that you've installed the package providing the 'seaborn' entrypoint, or that the package has a top-level `.plot` method.

Suggested fix for documentation

I think the easiest fix would be to coordinate with the ecosystem libraries to ensure they implement the pandas plotting backend. If there are technical limitations to doing so, maybe we should put the libraries that do not implement the backend into a different section? Going forward we could also make it a requirement for libraries to implement the backend to land on the ecosystem page

@datapythonista for thoughts

@WillAyd WillAyd added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 13, 2024
@WillAyd
Copy link
Member Author

WillAyd commented Apr 13, 2024

FWIW pandas_bokeh throws an entirely different error when you use that as a backend:

AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width

@rhshadrach
Copy link
Member

Going forward we could also make it a requirement for libraries to implement the backend to land on the ecosystem page

This sounds like a high bar for being on the ecosystem page compared to where I think the bar has been in past discussions.

What do you think of just putting (with some kind of color / bold highlighting) something like

This package implements the pandas backend and can be used with pandas plotting methods [see here]
This package does not implement the pandas backend and cannot be used with pandas plotting methods

@WillAyd
Copy link
Member Author

WillAyd commented Apr 13, 2024

Sure sounds good too. Open to anything that makes it clearer - right now it's pretty challenging to understand how the backend argument for plots works and which libraries even should support it.

I suppose could also question if we really need the backend argument for plots. I am under the impression that seaborn is one of the larger libraries, and people would just use that API directly.

@Aloqeely
Copy link
Contributor

Aloqeely commented Apr 14, 2024

What do you think of just putting (with some kind of color / bold highlighting) something like

This package implements the pandas backend and can be used with pandas plotting methods [see here]
This package does not implement the pandas backend and cannot be used with pandas plotting methods

But this will increase the maintenance burden of the ecosystem page, will we be checking whether each package implements the plotting backend every X period? And will we be checking which code samples run correctly and which libraries even work? The impression I get is that the page is community maintained.

As Mr. Ayd said, we should probably remove the backend argument. We could also stop linking to the ecosystem page in the plotting-backends doc, but then how will people know what to pass to the backend argument? So the better idea is to remove it.

@rhshadrach
Copy link
Member

rhshadrach commented Apr 14, 2024

As Mr. Ayd said, we should probably remove the backend argument.

I'm quite negative here, being able to use the plotly backend is a good feature in my opinion, and one we should not remove.

I do not find the maintenance of specifying which packages support the backend concerning at all.

@rhshadrach rhshadrach added Needs Discussion Requires discussion from core team before further action Visualization plotting and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 14, 2024
@WillAyd
Copy link
Member Author

WillAyd commented Apr 15, 2024

I didn't go through every backend but from sampling I could only get hvplot and plotly to work as a backend argument. And as mentioned before seems like pandas_bokeh has that intention but is broken.

I do not find the maintenance of specifying which packages support the backend concerning at all.

Its not the most important thing to solve, but its unfortunate we offer that without any integration testing. Maybe worth a separate initiative to add tests for at least plotly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Needs Discussion Requires discussion from core team before further action Visualization plotting
Projects
None yet
Development

No branches or pull requests

3 participants