You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
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
SubplotParams object to copy new subplot parameters from, or a dict
of SubplotParams constructor arguments.
By default, an empty dictionary is passed, which maintains the
current state of the figure's `.SubplotParams`
See Also
--------
matplotlib.figure.Figure.subplots_adjust
matplotlib.figure.Figure.get_subplotparams
"""
subplotparams_args = ["left", "bottom", "right",
"top", "wspace", "hspace"]
kwargs = {}
if isinstance(subplotparams, SubplotParams):
for key in subplotparams_args:
kwargs[key] = getattr(subplotparams, key)
Check warning on line 317 in lib/matplotlib/figure.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/figure.py#L317
Added line #L317 was not covered by tests
elif isinstance(subplotparams, dict):
for key in subplotparams.keys():
if key in subplotparams_args:
kwargs[key] = subplotparams[key]
else:
_api.warn_external(
Check warning on line 323 in lib/matplotlib/figure.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/figure.py#L323
Added line #L323 was not covered by tests
f"'{key}' is not a valid key for set_subplotparams;"
" this key was ignored.")
else:
raise TypeError(
Check warning on line 327 in lib/matplotlib/figure.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/figure.py#L327
Added line #L327 was not covered by tests
"subplotparams must be a dictionary of keyword-argument pairs or"
" an instance of SubplotParams()")
if kwargs == {}:
self.set_subplotparams(self.get_subplotparams())
self.subplots_adjust(**kwargs)
Check warning on line 332 in lib/matplotlib/figure.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/figure.py#L331-L332
Added lines #L331 - L332 were not covered by tests
def get_subplotparams(self):
"""
Check failure on line 335 in lib/matplotlib/figure.py
View workflow job for this annotation
GitHub Actions/ flake8
[flake8] reported by reviewdog 🐶D411 Missing blank line before sectionRaw Output:./lib/matplotlib/figure.py:335:1: D411 Missing blank line before section
Check failure on line 335 in lib/matplotlib/figure.py
View workflow job for this annotation
GitHub Actions/ flake8
[flake8] reported by reviewdog 🐶D411 Missing blank line before sectionRaw Output:./lib/matplotlib/figure.py:335:1: D411 Missing blank line before section
Return the `.SubplotParams` object associated with the Figure.
Returns
-------
.SubplotParams`
See Also
--------
matplotlib.figure.Figure.subplots_adjust
matplotlib.figure.Figure.get_subplotparams
"""
subplotparms = []
Check warning on line 345 in lib/matplotlib/figure.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/figure.py#L345
Added line #L345 was not covered by tests
for subfig in self.subfigs:
subplotparms.append(subfig.get_subplotparams())
return subplotparms
Check warning on line 348 in lib/matplotlib/figure.py
View check run for this annotation
Codecov/ codecov/patch
lib/matplotlib/figure.py#L347-L348
Added lines #L347 - L348 were not covered by tests
def contains(self, mouseevent):
Check failure on line 349 in lib/matplotlib/figure.py
View workflow job for this annotation
GitHub Actions/ flake8
[flake8] reported by reviewdog 🐶E301 expected 1 blank line, found 0Raw Output:./lib/matplotlib/figure.py:349:5: E301 expected 1 blank line, found 0
Check failure on line 349 in lib/matplotlib/figure.py
View workflow job for this annotation
GitHub Actions/ flake8
[flake8] reported by reviewdog 🐶E301 expected 1 blank line, found 0Raw Output:./lib/matplotlib/figure.py:349:5: E301 expected 1 blank line, found 0
"""
Test whether the mouse event occurred on the figure.
Check failure on line 2928 in lib/matplotlib/figure.py
View workflow job for this annotation
GitHub Actions/ flake8
[flake8] reported by reviewdog 🐶D411 Missing blank line before sectionRaw Output:./lib/matplotlib/figure.py:2928:1: D411 Missing blank line before section
Check failure on line 2928 in lib/matplotlib/figure.py
View workflow job for this annotation
GitHub Actions/ flake8
[flake8] reported by reviewdog 🐶D411 Missing blank line before sectionRaw Output:./lib/matplotlib/figure.py:2928:1: D411 Missing blank line before section
Return the `.SubplotParams` object associated with the Figure.
Returns
-------
.SubplotParams`
See Also
--------
matplotlib.figure.Figure.subplots_adjust
matplotlib.figure.Figure.get_subplotparams
"""
return self.subplotpars
def set_subplotparams(self, subplotparams={}):
"""
.. Set the subplot layout parameters.
Accepts either a `.SubplotParams` object, from which the relevant
parameters are copied, or a dictionary of subplot layout parameters.
If a dictionary is provided, this function is a convenience wrapper for
`matplotlib.figure.Figure.subplots_adjust`
Parameters
----------
subplotparams : `~matplotlib.figure.SubplotParams` or dict with keys
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
from collections.abc import Callable, Hashable, Iterable, Sequence
Check failure on line 1 in lib/matplotlib/figure.pyi
View workflow job for this annotation
GitHub Actions/ mypy-stubtest
[mypy-stubtest] reported by reviewdog 🐶matplotlib.figure.Figure.get_figsize is not present in stubMISSINGRuntime:<property object at 0x7f072d60cd10>Raw Output:error: matplotlib.figure.Figure.get_figsize is not present in stubStub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.pyiMISSINGRuntime:<property object at 0x7f072d60cd10>
Check failure on line 1 in lib/matplotlib/figure.pyi
View workflow job for this annotation
GitHub Actions/ mypy-stubtest
[mypy-stubtest] reported by reviewdog 🐶matplotlib.figure.Figure.set_figsize is not present in stubMISSINGRuntime:<property object at 0x7f070f13c0e0>Raw Output:error: matplotlib.figure.Figure.set_figsize is not present in stubStub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.pyiMISSINGRuntime:<property object at 0x7f070f13c0e0>
Check failure on line 1 in lib/matplotlib/figure.pyi
View workflow job for this annotation
GitHub Actions/ mypy-stubtest
[mypy-stubtest] reported by reviewdog 🐶matplotlib.figure.FigureBase.set_subplotparams is not present in stubMISSINGRuntime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.py:291def (self, subplotparams={})Raw Output:error: matplotlib.figure.FigureBase.set_subplotparams is not present in stubStub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.pyiMISSINGRuntime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.py:291def (self, subplotparams={})
Check failure on line 1 in lib/matplotlib/figure.pyi
View workflow job for this annotation
GitHub Actions/ mypy-stubtest
[mypy-stubtest] reported by reviewdog 🐶matplotlib.figure.Figure.get_figsize is not present in stubMISSINGRuntime:<property object at 0x7fd35616acf0>Raw Output:error: matplotlib.figure.Figure.get_figsize is not present in stubStub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.pyiMISSINGRuntime:<property object at 0x7fd35616acf0>
Check failure on line 1 in lib/matplotlib/figure.pyi
View workflow job for this annotation
GitHub Actions/ mypy-stubtest
[mypy-stubtest] reported by reviewdog 🐶matplotlib.figure.Figure.set_figsize is not present in stubMISSINGRuntime:<property object at 0x7fd381b6c4f0>Raw Output:error: matplotlib.figure.Figure.set_figsize is not present in stubStub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.pyiMISSINGRuntime:<property object at 0x7fd381b6c4f0>
Check failure on line 1 in lib/matplotlib/figure.pyi
View workflow job for this annotation
GitHub Actions/ mypy-stubtest
[mypy-stubtest] reported by reviewdog 🐶matplotlib.figure.FigureBase.set_subplotparams is not present in stubMISSINGRuntime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.py:291def (self, subplotparams={})Raw Output:error: matplotlib.figure.FigureBase.set_subplotparams is not present in stubStub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.pyiMISSINGRuntime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/figure.py:291def (self, subplotparams={})
import os
from typing import Any, IO, Literal, TypeVar, overload
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.