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

Commit5cd702d

Browse files
authored
Merge pull request#21033 from meeseeksmachine/auto-backport-of-pr-21017-on-v3.4.x
Backport PR#21017 on branch v3.4.x (FIX: Don't subslice lines if non-standard transform)
2 parentse48e4ac +083b381 commit5cd702d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

‎lib/matplotlib/lines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ def recache(self, always=False):
677677
self.axes.name=='rectilinear'and
678678
self.axes.get_xscale()=='linear'and
679679
self._markeveryisNoneand
680-
self.get_clip_on()):
680+
self.get_clip_on()and
681+
self.get_transform()==self.axes.transData):
681682
self._subslice=True
682683
nanmask=np.isnan(x)
683684
ifnanmask.any():

‎lib/matplotlib/tests/test_lines.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
frommatplotlib.markersimportMarkerStyle
1717
frommatplotlib.pathimportPath
1818
importmatplotlib.pyplotasplt
19+
importmatplotlib.transformsasmtransforms
1920
frommatplotlib.testing.decoratorsimportimage_comparison,check_figures_equal
2021

2122

@@ -131,6 +132,17 @@ def test_drawstyle_variants():
131132
ax.set(xlim=(0,2),ylim=(0,2))
132133

133134

135+
@check_figures_equal(extensions=('png',))
136+
deftest_no_subslice_with_transform(fig_ref,fig_test):
137+
ax=fig_ref.add_subplot()
138+
x=np.arange(2000)
139+
ax.plot(x+2000,x)
140+
141+
ax=fig_test.add_subplot()
142+
t=mtransforms.Affine2D().translate(2000.0,0.0)
143+
ax.plot(x,x,transform=t+ax.transData)
144+
145+
134146
deftest_valid_drawstyles():
135147
line=mlines.Line2D([], [])
136148
withpytest.raises(ValueError):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp