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

Using Pandas 0.21 auto-detection of dates fails in pyplot #18192

Closed
guivo opened this issue Nov 9, 2017 · 1 comment
Closed

Using Pandas 0.21 auto-detection of dates fails in pyplot #18192

guivo opened this issue Nov 9, 2017 · 1 comment

Comments

@guivo
Copy link

guivo commented Nov 9, 2017

Using the following code

plt.plot(pd.to_datetime(np.linspace(1501288700, 1501290000, 10), unit='s'), np.arange(10))
plt.show()

I obtain different result using 0.20 or 0.21.

Using the code above with Pandas 0.20 the plot automatically identifies that the X axes contains dates. While using pandas 0.21 this, or other attempts, to force the X axes to show dates in the axes. The two plots have been attached and as you can notice one has show the datetiem as "%d %H:%M", as expected, while the 2nd made with the latest package shows integers.

All the other packages are unchanged.

pandas20
pandas21

@TomAugspurger
Copy link
Contributor

This was an intentional change to not import matplotlib when pandas is imported. You can either use Series/DataFrame.plot, or explicitly register the pandas converters. (you can search around for duplicate issues for more info).

See matplotlib/matplotlib#9610 for a longer discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants