Skip to content

Commit 09c6124

Browse files
TYP: statically define attributes in plotting._matplotlib.core (#36068)
pandas\plotting\_matplotlib\core.py:231: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:232: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:233: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:235: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:385: error: "MPLPlot" has no attribute "label"; maybe "ylabel" or "xlabel"? [attr-defined] pandas\plotting\_matplotlib\core.py:553: error: "MPLPlot" has no attribute "mark_right" [attr-defined] pandas\plotting\_matplotlib\core.py:732: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:733: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:735: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:738: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:739: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:741: error: "MPLPlot" has no attribute "style" [attr-defined] pandas\plotting\_matplotlib\core.py:1008: error: "ScatterPlot" has no attribute "label" [attr-defined] pandas\plotting\_matplotlib\core.py:1075: error: "LinePlot" has no attribute "stacked" [attr-defined] pandas\plotting\_matplotlib\core.py:1180: error: "LinePlot" has no attribute "stacked" [attr-defined] pandas\plotting\_matplotlib\core.py:1269: error: "AreaPlot" has no attribute "stacked" [attr-defined] pandas\plotting\_matplotlib\core.py:1351: error: "BarPlot" has no attribute "stacked" [attr-defined] pandas\plotting\_matplotlib\core.py:1427: error: "BarPlot" has no attribute "stacked" [attr-defined]
1 parent 7d047c2 commit 09c6124

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

pandas/plotting/_matplotlib/core.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ def _kind(self):
6666
_layout_type = "vertical"
6767
_default_rot = 0
6868
orientation: Optional[str] = None
69-
_pop_attributes = [
70-
"label",
71-
"style",
72-
"mark_right",
73-
"stacked",
74-
]
75-
_attr_defaults = {
76-
"mark_right": True,
77-
"stacked": False,
78-
}
7969

8070
def __init__(
8171
self,
@@ -165,9 +155,10 @@ def __init__(
165155
self.logx = kwds.pop("logx", False)
166156
self.logy = kwds.pop("logy", False)
167157
self.loglog = kwds.pop("loglog", False)
168-
for attr in self._pop_attributes:
169-
value = kwds.pop(attr, self._attr_defaults.get(attr, None))
170-
setattr(self, attr, value)
158+
self.label = kwds.pop("label", None)
159+
self.style = kwds.pop("style", None)
160+
self.mark_right = kwds.pop("mark_right", True)
161+
self.stacked = kwds.pop("stacked", False)
171162

172163
self.ax = ax
173164
self.fig = fig

0 commit comments

Comments
 (0)