Skip to content

Commit 2797661

Browse files
committed
TYP: allow for xlim/ylim passed as single tuple
Found by running type checker over plotnine/xarray Also applies to rlim of polar and clim on colormaps
1 parent 2c4f552 commit 2797661

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/matplotlib/axes/_base.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class _AxesBase(martist.Artist):
312312
def get_xlim(self) -> tuple[float, float]: ...
313313
def set_xlim(
314314
self,
315-
left: float | None = ...,
315+
left: float | tuple[float, float] | None = ...,
316316
right: float | None = ...,
317317
*,
318318
emit: bool = ...,
@@ -338,7 +338,7 @@ class _AxesBase(martist.Artist):
338338
def get_ylim(self) -> tuple[float, float]: ...
339339
def set_ylim(
340340
self,
341-
bottom: float | None = ...,
341+
bottom: float | tuple[float, float] | None = ...,
342342
top: float | None = ...,
343343
*,
344344
emit: bool = ...,

lib/matplotlib/cm.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ScalarMappable:
4141
def get_array(self) -> np.ndarray | None: ...
4242
def get_cmap(self) -> colors.Colormap: ...
4343
def get_clim(self) -> tuple[float, float]: ...
44-
def set_clim(self, vmin: float | None = ..., vmax: float | None = ...) -> None: ...
44+
def set_clim(self, vmin: float | tuple[float, float] | None = ..., vmax: float | None = ...) -> None: ...
4545
def get_alpha(self) -> float | None: ...
4646
def set_cmap(self, cmap: str | colors.Colormap) -> None: ...
4747
@property

lib/matplotlib/projections/polar.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class PolarAxes(Axes):
159159
def get_rsign(self) -> float: ...
160160
def set_rlim(
161161
self,
162-
bottom: float | None = ...,
162+
bottom: float | tuple[float, float] | None = ...,
163163
top: float | None = ...,
164164
*,
165165
emit: bool = ...,

0 commit comments

Comments
 (0)