@@ -135,21 +135,16 @@ def test_axisline_style_tight():
135
135
fig .tight_layout ()
136
136
137
137
138
- @image_comparison (['subplotzero_ylabel.png' ], style = 'mpl20' )
138
+ @image_comparison (['subplotzero_ylabel.png' ])
139
139
def test_subplotzero_ylabel ():
140
140
fig = plt .figure ()
141
- ax = SubplotZero (fig , 111 )
142
- _ = fig .add_subplot (ax )
141
+ ax = fig .add_subplot (111 , axes_class = SubplotZero )
143
142
144
- for direction in ["xzero" , "yzero" ]:
145
- ax .axis [direction ].set_visible (True )
146
- ax .axis [direction ].set_axisline_style ("->" )
147
- # Set outward ticks
148
- ax .axis [direction ].major_ticks .set_tick_out (True )
149
- ax .axis [direction ].minor_ticks .set_tick_out (True )
143
+ ax .set (xlim = (- 3 , 7 ), ylim = (- 3 , 7 ), xlabel = "x" , ylabel = "y" )
150
144
151
- ax .axis ["yzero" ].set_axis_direction ("left" )
145
+ zero_axis = ax .axis ["xzero" , "yzero" ]
146
+ zero_axis .set_visible (True ) # they are hidden by default
152
147
153
- plt . plot ([ 0 , 1 ], [ 0 , 1 ], c = "blue " , lw = 2 )
154
- plt . xlabel ( 'x' )
155
- plt . ylabel ( 'y' )
148
+ ax . axis [ "left" , "right" , "bottom " , "top" ]. set_visible ( False )
149
+
150
+ zero_axis . set_axisline_style ( "->" )
0 commit comments