-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DataArray plotting: pyplot compat and passing the style #2837
Comments
matplotlib only knows about numpy arrays so the way to do what you want is using kwargs Can you open a PR to improve the documentation on these points please? |
How does it (matplotlib) preserve Series index then?
Would it make sense to make it (DA plotting interface) a bit more pandas-compatible by supporting Also, if Currently, neither of the two options above work, making DA plot interface inferior to both raw matplotlib and pandas. |
I think it plots assuming that the index is [0:len(da.values)]. ping @pydata/xarray for opinions on adding the |
Nope. It plots datetime index just fine. |
I would support adding |
@aldanor Would you like to tackle this problem and send in a PR? |
These are two unrelated issues in one really that I've noticed while trying to plot things directly from DataArray objects.
The following works as expected, by converting DataArray to pandas first)
Passing Series to pyplot.plot() directly also works and retains index:
Trying to set style directly when plotting from DataArray doesn't work:
Passing DataArray to pyplot.plot() loses index:
The text was updated successfully, but these errors were encountered: