We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecd4abb commit 6e2d3aeCopy full SHA for 6e2d3ae
pandas/plotting/_matplotlib/timeseries.py
@@ -251,11 +251,7 @@ def _maybe_convert_index(ax, data):
251
freq = frequencies.get_period_alias(freq)
252
253
if isinstance(data.index, ABCDatetimeIndex):
254
- if data.index.tz is not None:
255
- data = data.tz_convert(None).to_period(freq=freq)
256
- else:
257
- # can't convert tz-naive
258
- data = data.to_period(freq=freq)
+ data = data.tz_localize(None).to_period(freq=freq)
259
elif isinstance(data.index, ABCPeriodIndex):
260
data.index = data.index.asfreq(freq=freq)
261
return data
0 commit comments