Open jlchang opened 12 hours ago
Thanks for the report, confirmed in main.
as a workaround, you can run albany['circulation'].sort_index().plot()
to get the desired output.
Seems to stem from #55906 where the sorting of the index was removed.
cc @jbrockmendel
simpler reproducer: (slightly modifed the test at pandas/tests/plotting/frame/test_frame.py:test_unordered_ts
from datetime import date
import pandas as pd
import numpy as np
index = [date(2012, 10, 1), date(2012, 8, 1), date(2012, 9, 1)]
values = [3.0, 2.0, 1.0]
df = pd.DataFrame(
np.array(values),
index=index,
columns=["test"],
)
df.plot()
v2.0.3
main
Thank you for the workaround. And thank you to the pandas
team for an incredible library. It is a vital to my daily work.
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
FYI, Pandas 2.2.2 seems to have a plotting bug (this does not seem to be specific to Colab). For this tutorial, running
albany['circulation'].plot()
renders:Expected Behavior
The expected plot looks like:
Pandas
2.0.3
generates the expected plot (Pandas2.2.3
is also problematic)Installed Versions
Python 3.10.9 on Mac M1 Max running Sonoma 14.6.1 (23G93)
The same issue happens in Google Colab which is running Python 3.10.12