File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
pandas/plotting/_matplotlib Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,13 @@ def maybe_convert_index(ax: Axes, data: NDFrameT) -> NDFrameT:
308308 if isinstance (data .index , ABCDatetimeIndex ):
309309 data = data .tz_localize (None ).to_period (freq = freq_str )
310310 elif isinstance (data .index , ABCPeriodIndex ):
311- data .index = data .index .asfreq (freq = freq_str , how = "start" )
311+ # This will convert e.g. freq="60min" to freq="min", but will
312+ # retain type(freq). It is not clear to @jbrockmendel why
313+ # this is necessary as of 2025-09-24, but 18 tests fail
314+ # without it.
315+ new_freq = to_offset (freq_str , is_period = True )
316+ assert type (new_freq ) is type (data .index .freq )
317+ data .index = data .index .asfreq (freq = new_freq , how = "start" )
312318 return data
313319
314320
You can’t perform that action at this time.
0 commit comments