Skip to content

REGR: Bar plot axis timestamp to string conversion error #46413

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from pandas import (
DataFrame,
Series,
Timestamp,
)
import pandas._testing as tm
from pandas.tests.plotting.common import (
Expand Down Expand Up @@ -549,3 +550,15 @@ def test_externally_shared_axes(self):
assert not plots[0][0].xaxis.get_label().get_visible()
assert plots[0][1].xaxis.get_label().get_visible()
assert not plots[0][2].xaxis.get_label().get_visible()

def test_plot_bar_axis_units_timestamp_conversion(self):
# GH 38736
# Ensure string x-axis from the second plot will not be converted to datetime
# due to axis data from first plot
df = DataFrame(
[1.0],
index=[Timestamp("2022-02-22 22:22:22")],
)
_check_plot_works(df.plot)
s = Series({"A": 1.0})
_check_plot_works(s.plot.bar)