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

ENH: add `ax` kwarg to every pyplot function by tacaswell · Pull Request #9111 · matplotlib/matplotlib · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) .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
Prev Previous commit
STY: attempt to placate mypy
Bit confused why it was not hitting these before.
  • Loading branch information
tacaswell committed Jul 3, 2023
commit 2c7f076e1284fe188535ea62fae746f2d8fa3ed6
4 changes: 4 additions & 0 deletions lib/matplotlib/cm.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 @@ -24,6 +24,10 @@ class ScalarMappable:
cmap: colors.Colormap | None
colorbar: Colorbar | None
callbacks: cbook.CallbackRegistry

# private use
_A: ArrayLike | None

def __init__(
self,
norm: colors.Normalize | None = ...,
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/pyplot.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 @@ -1086,12 +1086,12 @@ def draw(*, fig: Figure | None = None) -> None:

@_copy_docstring_and_deprecators(Figure.savefig)
def savefig(*args, **kwargs) -> None:
fig = kwargs.pop('fig', None) or gcf()
# savefig default implementation has no return, so mypy is unhappy
# presumably this is here because subclasses can return?
fig = kwargs.pop('fig', None) or gcf()
res = fig.savefig(*args, **kwargs)
res = fig.savefig(*args, **kwargs) # type: ignore[func-returns-value]
fig.canvas.draw_idle() # Need this if 'transparent=True', to reset colors.
return res
return res # type: ignore[return-value]


## Putting things in figures ##
Expand Down

Back | FazBrowse Home | New Git URL