Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow setting of aspect ratio for Axes in rcParams - Draft PR#30017

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
ebubekir-pulat wants to merge4 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromebubekir-pulat:feature-for-issue-8088
Draft
Show file tree
Hide file tree
Changes fromall 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
4 changes: 2 additions & 2 deletionslib/matplotlib/axes/_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -680,8 +680,8 @@ def __init__(self, fig,
raise ValueError('Width and height specified must be non-negative')
self._originalPosition = self._position.frozen()
self.axes = self
self._aspect ='auto'
self._adjustable ='box'
self._aspect =mpl.rcParams['axes.aspect']
self._adjustable =mpl.rcParams['axes.adjustable']
self._anchor = 'C'
self._stale_viewlims = dict.fromkeys(self._axis_names, False)
self._forward_navigation_events = forward_navigation_events
Expand Down
2 changes: 2 additions & 0 deletionslib/matplotlib/mpl-data/matplotlibrc
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,8 @@
#axes.labelpad: 4.0 # space between label and axis
#axes.labelweight: normal # weight of the x and y labels
#axes.labelcolor: black
#axes.aspect: auto # {auto, equal} or a number
#axes.adjustable: box # box or datalim
#axes.axisbelow: line # draw axis gridlines and ticks:
# - below patches (True)
# - above patches but below lines ('line')
Expand Down
2 changes: 2 additions & 0 deletionslib/matplotlib/mpl-data/stylelib/classic.mplstyle
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -185,6 +185,8 @@ axes.labelsize : medium # fontsize of the x any y labels
axes.labelpad : 5.0 # space between label and axis
axes.labelweight : normal # weight of the x and y labels
axes.labelcolor : k
axes.aspect : auto # auto | equal | a number
axes.adjustable : box # box | datalim
axes.axisbelow : False # whether axis gridlines and ticks are below
# the axes elements (lines, text, etc)

Expand Down
7 changes: 6 additions & 1 deletionlib/matplotlib/rcsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -397,8 +397,10 @@ def _validate_cmap(s):


def validate_aspect(s):
if sin ('auto', 'equal'):
if s=='auto':
return s
if s == 'equal':
return 1
try:
return float(s)
except ValueError as e:
Expand DownExpand Up@@ -1108,6 +1110,9 @@ def _convert_validator_spec(key, conv):
"axes.spines.bottom": validate_bool, # denoting data boundary.
"axes.spines.top": validate_bool,

"axes.aspect": validate_aspect, # auto, equal, a number
"axes.adjustable": ["box", "datalim"],

"axes.titlesize": validate_fontsize, # Axes title fontsize
"axes.titlelocation": ["left", "center", "right"], # Axes title alignment
"axes.titleweight": validate_fontweight, # Axes title font weight
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp