Skip to content

Commit a95e7ff

Browse files
author
Khor Chean Wei
authored
Merge branch 'main' into enh-consistency-interval-range
2 parents e995574 + b14d62e commit a95e7ff

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/plotting/test_misc.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pandas import (
99
DataFrame,
1010
Series,
11+
Timestamp,
1112
)
1213
import pandas._testing as tm
1314
from pandas.tests.plotting.common import (
@@ -549,3 +550,15 @@ def test_externally_shared_axes(self):
549550
assert not plots[0][0].xaxis.get_label().get_visible()
550551
assert plots[0][1].xaxis.get_label().get_visible()
551552
assert not plots[0][2].xaxis.get_label().get_visible()
553+
554+
def test_plot_bar_axis_units_timestamp_conversion(self):
555+
# GH 38736
556+
# Ensure string x-axis from the second plot will not be converted to datetime
557+
# due to axis data from first plot
558+
df = DataFrame(
559+
[1.0],
560+
index=[Timestamp("2022-02-22 22:22:22")],
561+
)
562+
_check_plot_works(df.plot)
563+
s = Series({"A": 1.0})
564+
_check_plot_works(s.plot.bar)

0 commit comments

Comments
 (0)