Skip to content

Added figsize and layout getters and setters for Figure.__init__ #29632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""
`matplotlib.figure` implements the following classes:

Expand Down Expand Up @@ -2644,6 +2644,18 @@
self._axstack = _AxesStack() # track all figure Axes and current Axes
self.clear()

def set_figsize(self, fig_size_params):
self.set_size_inches(fig_size_params[0], fig_size_params[1])

Check warning on line 2648 in lib/matplotlib/figure.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/figure.py#L2648

Added line #L2648 was not covered by tests

def get_figsize(self):
return self.get_size_inches()

Check warning on line 2651 in lib/matplotlib/figure.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/figure.py#L2651

Added line #L2651 was not covered by tests

def set_layout(self, layout_params):
self.set_layout_engine(layout_params)

Check warning on line 2654 in lib/matplotlib/figure.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/figure.py#L2654

Added line #L2654 was not covered by tests

def get_layout(self):
return self.get_layout_engine()

Check warning on line 2657 in lib/matplotlib/figure.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/figure.py#L2657

Added line #L2657 was not covered by tests

def pick(self, mouseevent):
if not self.canvas.widgetlock.locked():
super().pick(mouseevent)
Expand Down
Loading