File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 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):
677677 self .axes .name == 'rectilinear' and
678678 self .axes .get_xscale () == 'linear' and
679679 self ._markevery is None and
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 if nanmask .any ():
Original file line number Diff line number Diff line change 1616from matplotlib .markers import MarkerStyle
1717from matplotlib .path import Path
1818import matplotlib .pyplot as plt
19+ import matplotlib .transforms as mtransforms
1920from matplotlib .testing .decorators import image_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+ 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+
134146def test_valid_drawstyles ():
135147 line = mlines .Line2D ([], [])
136148 with pytest .raises (ValueError ):
You can’t perform that action at this time.
0 commit comments