MCPcopy
hub / github.com/pandas-dev/pandas / _plot

Method _plot

pandas/plotting/_matplotlib/core.py:977–997  ·  view source on GitHub ↗
(
        cls, ax: Axes, x, y: np.ndarray, style=None, is_errorbar: bool = False, **kwds
    )

Source from the content-addressed store, hash-verified

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"""

Callers 2

_plotMethod · 0.45
_plotMethod · 0.45

Calls 6

isnaFunction · 0.90
_mpl_reprMethod · 0.80
anyMethod · 0.45
arrayMethod · 0.45
getMethod · 0.45
plotMethod · 0.45

Tested by

no test coverage detected