@@ -720,8 +720,7 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
720
720
yy = self .convert_yunits (y )
721
721
scaley = (yy < ymin ) or (yy > ymax )
722
722
723
- trans = mtransforms .blended_transform_factory (
724
- self .transAxes , self .transData )
723
+ trans = self .get_yaxis_transform (which = 'grid' )
725
724
l = mlines .Line2D ([xmin , xmax ], [y , y ], transform = trans , ** kwargs )
726
725
self .add_line (l )
727
726
self .autoscale_view (scalex = False , scaley = scaley )
@@ -787,8 +786,7 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
787
786
xx = self .convert_xunits (x )
788
787
scalex = (xx < xmin ) or (xx > xmax )
789
788
790
- trans = mtransforms .blended_transform_factory (
791
- self .transData , self .transAxes )
789
+ trans = self .get_xaxis_transform (which = 'grid' )
792
790
l = mlines .Line2D ([x , x ], [ymin , ymax ], transform = trans , ** kwargs )
793
791
self .add_line (l )
794
792
self .autoscale_view (scalex = scalex , scaley = False )
@@ -833,8 +831,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
833
831
.. plot:: mpl_examples/pylab_examples/axhspan_demo.py
834
832
835
833
"""
836
- trans = mtransforms .blended_transform_factory (
837
- self .transAxes , self .transData )
834
+ trans = self .get_yaxis_transform (which = 'grid' )
838
835
839
836
# process the unit information
840
837
self ._process_unit_info ([xmin , xmax ], [ymin , ymax ], kwargs = kwargs )
@@ -889,8 +886,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
889
886
:meth:`axhspan`
890
887
for example plot and source code
891
888
"""
892
- trans = mtransforms .blended_transform_factory (
893
- self .transData , self .transAxes )
889
+ trans = self .get_xaxis_transform (which = 'grid' )
894
890
895
891
# process the unit information
896
892
self ._process_unit_info ([xmin , xmax ], [ymin , ymax ], kwargs = kwargs )
@@ -3949,8 +3945,7 @@ def coarse_bin(x, y, coarse):
3949
3945
values .append (val )
3950
3946
3951
3947
values = np .array (values )
3952
- trans = mtransforms .blended_transform_factory (
3953
- self .transData , self .transAxes )
3948
+ trans = self .get_xaxis_transform (which = 'grid' )
3954
3949
3955
3950
hbar = mcoll .PolyCollection (verts , transform = trans , edgecolors = 'face' )
3956
3951
@@ -3979,8 +3974,7 @@ def coarse_bin(x, y, coarse):
3979
3974
3980
3975
values = np .array (values )
3981
3976
3982
- trans = mtransforms .blended_transform_factory (
3983
- self .transAxes , self .transData )
3977
+ trans = self .get_yaxis_transform (which = 'grid' )
3984
3978
3985
3979
vbar = mcoll .PolyCollection (verts , transform = trans , edgecolors = 'face' )
3986
3980
vbar .set_array (values )
0 commit comments