diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index 6121f2097a2f1..bb74a68ca9445 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -1249,6 +1249,7 @@ Plotting - Bug in :meth:`Series.plot` preventing a line and bar from being aligned on the same plot (:issue:`61161`) - Bug in :meth:`Series.plot` preventing a line and scatter plot from being aligned (:issue:`61005`) - Bug in :meth:`Series.plot` with ``kind="pie"`` with :class:`ArrowDtype` (:issue:`59192`) +- Bug in plotting with a :class:`TimedeltaIndex` with non-nanosecond resolution displaying incorrect labels (:issue:`63237`) Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pandas/plotting/_matplotlib/converter.py b/pandas/plotting/_matplotlib/converter.py index 5d06cbb8e8d2e..813bd984cf297 100644 --- a/pandas/plotting/_matplotlib/converter.py +++ b/pandas/plotting/_matplotlib/converter.py @@ -1107,7 +1107,7 @@ def __init__(self, unit: TimeUnit = "ns"): axis: Axis @staticmethod - def format_timedelta_ticks(x, pos, n_decimals: int, exp: int) -> str: + def format_timedelta_ticks(x, pos, n_decimals: int, exp: int = 9) -> str: """ Convert seconds to 'D days HH:MM:SS.F' """