FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make `functions` param to secondary_x/yaxis not keyword-only. by anntzer · Pull Request #28133 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .pyi  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion galleries/users_explain/quick_start.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def my_plotter(ax, data1, data2, param_dict):

ax3.plot(t, s)
ax3.set_xlabel('Angle [rad]')
ax4 = ax3.secondary_xaxis('top', functions=(np.rad2deg, np.deg2rad))
ax4 = ax3.secondary_xaxis('top', (np.rad2deg, np.deg2rad))
ax4.set_xlabel('Angle [°]')

# %%
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
return self.indicate_inset(rect, inset_ax, **kwargs)

@_docstring.dedent_interpd
def secondary_xaxis(self, location, *, functions=None, transform=None, **kwargs):
def secondary_xaxis(self, location, functions=None, *, transform=None, **kwargs):
"""
Add a second x-axis to this `~.axes.Axes`.

Expand Down Expand Up @@ -624,7 +624,7 @@ def invert(x):
return secondary_ax

@_docstring.dedent_interpd
def secondary_yaxis(self, location, *, functions=None, transform=None, **kwargs):
def secondary_yaxis(self, location, functions=None, *, transform=None, **kwargs):
"""
Add a second y-axis to this `~.axes.Axes`.

Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,24 @@ class Axes(_AxesBase):
def secondary_xaxis(
self,
location: Literal["top", "bottom"] | float,
*,
functions: tuple[
Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
]
| Transform
| None = ...,
*,
transform: Transform | None = ...,
**kwargs
) -> SecondaryAxis: ...
def secondary_yaxis(
self,
location: Literal["left", "right"] | float,
*,
functions: tuple[
Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
]
| Transform
| None = ...,
*,
transform: Transform | None = ...,
**kwargs
) -> SecondaryAxis: ...
Expand Down

Back | FazBrowse Home | New Git URL