Skip to content

Commit 3aecf97

Browse files
committed
TYP: plotting
1 parent 48865f4 commit 3aecf97

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

pandas/plotting/_matplotlib/boxplot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def _make_plot(self, fig: Figure) -> None:
251251
def _make_legend(self) -> None:
252252
pass
253253

254-
def _post_plot_logic(self, ax, data) -> None:
254+
def _post_plot_logic(self, ax: Axes, data) -> None:
255255
# GH 45465: make sure that the boxplot doesn't ignore xlabel/ylabel
256256
if self.xlabel:
257257
ax.set_xlabel(pprint_thing(self.xlabel))

pandas/plotting/_matplotlib/core.py

+20-6
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def _has_plotted_object(ax: Axes) -> bool:
477477
return len(ax.lines) != 0 or len(ax.artists) != 0 or len(ax.containers) != 0
478478

479479
@final
480-
def _maybe_right_yaxis(self, ax: Axes, axes_num: int):
480+
def _maybe_right_yaxis(self, ax: Axes, axes_num: int) -> Axes:
481481
if not self.on_right(axes_num):
482482
# secondary axes may be passed via ax kw
483483
return self._get_ax_layer(ax)
@@ -666,7 +666,7 @@ def _add_table(self) -> None:
666666
tools.table(ax, data)
667667

668668
@final
669-
def _post_plot_logic_common(self, ax, data):
669+
def _post_plot_logic_common(self, ax: Axes, data) -> None:
670670
"""Common post process for each axes"""
671671
if self.orientation == "vertical" or self.orientation is None:
672672
self._apply_axis_properties(ax.xaxis, rot=self.rot, fontsize=self.fontsize)
@@ -685,7 +685,7 @@ def _post_plot_logic_common(self, ax, data):
685685
raise ValueError
686686

687687
@abstractmethod
688-
def _post_plot_logic(self, ax, data) -> None:
688+
def _post_plot_logic(self, ax: Axes, data) -> None:
689689
"""Post process for each axes. Overridden in child classes"""
690690

691691
@final
@@ -1039,7 +1039,7 @@ def _get_colors(
10391039
)
10401040

10411041
@final
1042-
def _parse_errorbars(self, label, err):
1042+
def _parse_errorbars(self, label: str, err):
10431043
"""
10441044
Look for error keyword arguments and return the actual errorbar data
10451045
or return the error DataFrame/dict
@@ -1835,7 +1835,14 @@ def _post_plot_logic(self, ax: Axes, data) -> None:
18351835

18361836
self._decorate_ticks(ax, self._get_index_name(), str_index, s_edge, e_edge)
18371837

1838-
def _decorate_ticks(self, ax: Axes, name, ticklabels, start_edge, end_edge) -> None:
1838+
def _decorate_ticks(
1839+
self,
1840+
ax: Axes,
1841+
name: str | None,
1842+
ticklabels: list[str],
1843+
start_edge: float,
1844+
end_edge: float,
1845+
) -> None:
18391846
ax.set_xlim((start_edge, end_edge))
18401847

18411848
if self.xticks is not None:
@@ -1880,7 +1887,14 @@ def _plot( # type: ignore[override]
18801887
def _get_custom_index_name(self):
18811888
return self.ylabel
18821889

1883-
def _decorate_ticks(self, ax: Axes, name, ticklabels, start_edge, end_edge) -> None:
1890+
def _decorate_ticks(
1891+
self,
1892+
ax: Axes,
1893+
name: str | None,
1894+
ticklabels: list[str],
1895+
start_edge: float,
1896+
end_edge: float,
1897+
) -> None:
18841898
# horizontal bars
18851899
ax.set_ylim((start_edge, end_edge))
18861900
ax.set_yticks(self.tick_pos)

pandas/plotting/_matplotlib/hist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _make_plot_keywords(self, kwds: dict[str, Any], y: np.ndarray) -> None:
269269
kwds["bw_method"] = self.bw_method
270270
kwds["ind"] = self._get_ind(y, ind=self.ind)
271271

272-
def _post_plot_logic(self, ax, data) -> None:
272+
def _post_plot_logic(self, ax: Axes, data) -> None:
273273
ax.set_ylabel("Density")
274274

275275

0 commit comments

Comments
 (0)