diff --git a/doc/source/whatsnew/v1.3.0.rst b/doc/source/whatsnew/v1.3.0.rst index 21e6f0ea57451..d021b32b99590 100644 --- a/doc/source/whatsnew/v1.3.0.rst +++ b/doc/source/whatsnew/v1.3.0.rst @@ -728,7 +728,7 @@ Plotting - Bug in :func:`scatter_matrix` raising when 2d ``ax`` argument passed (:issue:`16253`) - Prevent warnings when matplotlib's ``constrained_layout`` is enabled (:issue:`25261`) -- +- Bug in :meth:`MPLPlot._plot` ignoring ``style`` when using error bars (:issue:`7023`) Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index c9c12d8d5788a..7271adb722775 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -706,6 +706,8 @@ def _plot(cls, ax: Axes, x, y, style=None, is_errorbar: bool = False, **kwds): kwds["xerr"] = np.array(kwds.get("xerr")) if "yerr" in kwds: kwds["yerr"] = np.array(kwds.get("yerr")) + if style is not None: + kwds["fmt"] = style return ax.errorbar(x, y, **kwds) else: # prevent style kwarg from going to errorbar, where it is unsupported