File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -677,7 +677,8 @@ def recache(self, always=False):
677
677
self .axes .name == 'rectilinear' and
678
678
self .axes .get_xscale () == 'linear' and
679
679
self ._markevery is None and
680
- self .get_clip_on ()):
680
+ self .get_clip_on () and
681
+ self .get_transform () == self .axes .transData ):
681
682
self ._subslice = True
682
683
nanmask = np .isnan (x )
683
684
if nanmask .any ():
Original file line number Diff line number Diff line change 16
16
from matplotlib .markers import MarkerStyle
17
17
from matplotlib .path import Path
18
18
import matplotlib .pyplot as plt
19
+ import matplotlib .transforms as mtransforms
19
20
from matplotlib .testing .decorators import image_comparison , check_figures_equal
20
21
21
22
@@ -131,6 +132,17 @@ def test_drawstyle_variants():
131
132
ax .set (xlim = (0 , 2 ), ylim = (0 , 2 ))
132
133
133
134
135
+ @check_figures_equal (extensions = ('png' ,))
136
+ def test_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
+
134
146
def test_valid_drawstyles ():
135
147
line = mlines .Line2D ([], [])
136
148
with pytest .raises (ValueError ):
You can’t perform that action at this time.
0 commit comments