| 975 | @classmethod |
| 976 | @register_pandas_matplotlib_converters |
| 977 | def _plot( |
| 978 | cls, ax: Axes, x, y: np.ndarray, style=None, is_errorbar: bool = False, **kwds |
| 979 | ): |
| 980 | mask = isna(y) |
| 981 | if mask.any(): |
| 982 | y = np.ma.array(y) |
| 983 | y = np.ma.masked_where(mask, y) |
| 984 | |
| 985 | if isinstance(x, ABCIndex): |
| 986 | x = x._mpl_repr() |
| 987 | |
| 988 | if is_errorbar: |
| 989 | if "xerr" in kwds: |
| 990 | kwds["xerr"] = np.array(kwds.get("xerr")) |
| 991 | if "yerr" in kwds: |
| 992 | kwds["yerr"] = np.array(kwds.get("yerr")) |
| 993 | return ax.errorbar(x, y, **kwds) |
| 994 | else: |
| 995 | # prevent style kwarg from going to errorbar, where it is unsupported |
| 996 | args = (x, y, style) if style is not None else (x, y) |
| 997 | return ax.plot(*args, **kwds) |
| 998 | |
| 999 | def _get_custom_index_name(self): |
| 1000 | """Specify whether xlabel/ylabel should be used to override index name""" |