Repository: matplotlib/matplotlib
File: lib/matplotlib/axes/_axes.pyi (Python)

Code before:
    def get_title(self, loc: Literal["left", "center", "right"] = ...) -> str: ...
    def set_title(
        self,
        label: str,
        fontdict: dict[str, Any] | None = ...,
        loc: Literal["left", "center", "right"] | None = ...,
        pad: float | None = ...,
        *,
        y: float | None = ...,
        **kwargs
    ) -> Text: ...
    def get_legend_handles_labels(
        self, legend_handler_map: dict[type, HandlerBase] | None = ...
    ) -> tuple[list[Artist], list[Any]]: ...
    legend_: Legend | None

    @overload
    def legend(self) -> Legend: ...
    @overload
    def legend(self, handles: Iterable[Artist | tuple[Artist, ...]], labels: Iterable[str],
               *, loc: LegendLocType | None = ..., **kwargs) -> Legend: ...
    @overload
    def legend(self, *, handles: Iterable[Artist | tuple[Artist, ...]],
               loc: LegendLocType | None = ..., **kwargs) -> Legend: ...
    @overload
    def legend(self, labels: Iterable[str],
               *, loc: LegendLocType | None = ..., **kwargs) -> Legend: ...
    @overload
    def legend(self, *, loc: LegendLocType | None = ..., **kwargs) -> Legend: ...

    def inset_axes(
        self,
        bounds: tuple[float, float, float, float],
        *,
        transform: Transform | None = ...,
        zorder: float = ...,
        **kwargs
    ) -> Axes: ...
    def indicate_inset(
        self,
        bounds: tuple[float, float, float, float] | None = ...,
        inset_ax: Axes | None = ...,
        *,
        transform: Transform | None = ...,
        facecolor: ColorType = ...,
        edgecolor: ColorType = ...,
        alpha: float = ...,
        zorder: float | None = ...,
        **kwargs
    ) -> InsetIndicator: ...
    def indicate_inset_zoom(self, inset_ax: Axes, **kwargs) -> InsetIndicator: ...

Review comment (suggestion):
I hope this works. I've pulled `loc` out of kwargs only for the stub; the method signature still does not contain it and handles it via `kwargs` instead. At least mypy doesn't complain, but I don't understand typing well enough whether that's guaranteed to work.

Code after:
    bar_containers: list[BarContainer]
    def __init__(self, bar_containers: list[BarContainer]) -> None: ...
    def remove(self) -> None: ...

class Axes(_AxesBase):
    def get_title(self, loc: Literal["left", "center", "right"] = ...) -> str: ...
    def set_title(
        self,
        label: str,
        fontdict: dict[str, Any] | None = ...,
        loc: Literal["left", "center", "right"] | None = ...,
        pad: float | None = ...,
        *,
        y: float | None = ...,
        **kwargs
    ) -> Text: ...
    def get_legend_handles_labels(
        self, legend_handler_map: dict[type, HandlerBase] | None = ...
    ) -> tuple[list[Artist], list[Any]]: ...
    legend_: Legend | None

    @overload
    def legend(self) -> Legend: ...
    @overload
    def legend(self, handles: Iterable[Artist | tuple[Artist, ...]], labels: Iterable[str],
               *, loc: LegendLocType | None = ..., **kwargs) -> Legend: ...
    @overload
    def legend(self, *, handles: Iterable[Artist | tuple[Artist, ...]],
               loc: LegendLocType | None = ..., **kwargs) -> Legend: ...
    @overload
    def legend(self, labels: Iterable[str],
               *, loc: LegendLocType | None = ..., **kwargs) -> Legend: ...
    @overload
    def legend(self, *, loc: LegendLocType | None = ..., **kwargs) -> Legend: ...

    def inset_axes(
        self,
        bounds: tuple[float, float, float, float],
        *,
        transform: Transform | None = ...,
        zorder: float = ...,
        **kwargs
    ) -> Axes: ...
    def indicate_inset(
        self,
        bounds: tuple[float, float, float, float] | None = ...,
        inset_ax: Axes | None = ...,
        *,
        transform: Transform | None = ...,
        facecolor: ColorType = ...,
        edgecolor: ColorType = ...,