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 @@ -664,7 +664,8 @@ def recache(self, always=False):
664
664
self .axes .name == 'rectilinear' and
665
665
self .axes .get_xscale () == 'linear' and
666
666
self ._markevery is None and
667
- self .get_clip_on ()):
667
+ self .get_clip_on () and
668
+ self .get_transform () == self .axes .transData ):
668
669
self ._subslice = True
669
670
nanmask = np .isnan (x )
670
671
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