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

Commit68cc2f3

Browse files
committed
Clarify axis sharing with aspect ratio control
- Axis sharing works across figures.- The "box-forced" adjustable is no longer needed.- Sharing both axes requires the use of "box", not "datalim".- A new "share" kwarg triggers synchronized setting of aspect ratio and adjustable in Axes within shared axis groups.- Added a test for axis sharing with aspect ratio setting.- Fixed and updated skew_rects test.
1 parent3c1f423 commit68cc2f3

File tree

8 files changed

+1744
-1652
lines changed

8 files changed

+1744
-1652
lines changed

‎lib/matplotlib/axes/_base.py

Lines changed: 118 additions & 87 deletions
Large diffs are not rendered by default.

‎lib/matplotlib/axes/_subplots.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,21 @@ def label_outer(self):
144144

145145
def_make_twin_axes(self,*kl,**kwargs):
146146
"""
147-
make a twinx axes of self. This is used for twinx and twiny.
147+
Make a twinx axes of self. This is used for twinx and twiny.
148148
"""
149149
frommatplotlib.projectionsimportprocess_projection_requirements
150+
if'sharex'inkwargsand'sharey'inkwargs:
151+
raiseValueError("Twinned Axes may share only one axis.")
150152
kl= (self.get_subplotspec(),)+kl
151153
projection_class,kwargs,key=process_projection_requirements(
152154
self.figure,*kl,**kwargs)
153155

154156
ax2=subplot_class_factory(projection_class)(self.figure,
155157
*kl,**kwargs)
156158
self.figure.add_subplot(ax2)
159+
self.set_adjustable('datalim')
160+
ax2.set_adjustable('datalim')
161+
self._twinned_axes.join(self,ax2)
157162
returnax2
158163

159164
_subplot_classes= {}
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp