@@ -4500,6 +4500,28 @@ def test_pie_textprops():
4500
4500
assert tx .get_color () == textprops ["color" ]
4501
4501
4502
4502
4503
+ def test_pie_get_negative_values ():
4504
+ # Test the ValueError raised when feeding negative values into axes.pie
4505
+ fig , ax = plt .subplots ()
4506
+ with pytest .raises (ValueError ):
4507
+ ax .pie ([5 , 5 , - 3 ], explode = [0 , .1 , .2 ])
4508
+
4509
+
4510
+ def test_normalize_kwarg_warn_pie ():
4511
+ fig , ax = plt .subplots ()
4512
+ with pytest .warns (MatplotlibDeprecationWarning ):
4513
+ ax .pie (x = [0 ], normalize = None )
4514
+
4515
+
4516
+ def test_normalize_kwarg_pie ():
4517
+ fig , ax = plt .subplots ()
4518
+ x = [0.3 , 0.3 , 0.1 ]
4519
+ t1 = ax .pie (x = x , normalize = True )
4520
+ assert abs (t1 [0 ][- 1 ].theta2 - 360. ) < 1e-3
4521
+ t2 = ax .pie (x = x , normalize = False )
4522
+ assert abs (t2 [0 ][- 1 ].theta2 - 360. ) > 1e-3
4523
+
4524
+
4503
4525
@image_comparison (['set_get_ticklabels.png' ])
4504
4526
def test_set_get_ticklabels ():
4505
4527
# test issue 2246
@@ -6208,13 +6230,6 @@ def test_bbox_aspect_axes_init():
6208
6230
assert_allclose (sizes , sizes [0 ])
6209
6231
6210
6232
6211
- def test_pie_get_negative_values ():
6212
- # Test the ValueError raised when feeding negative values into axes.pie
6213
- fig , ax = plt .subplots ()
6214
- with pytest .raises (ValueError ):
6215
- ax .pie ([5 , 5 , - 3 ], explode = [0 , .1 , .2 ])
6216
-
6217
-
6218
6233
def test_invisible_axes ():
6219
6234
# invisible axes should not respond to events...
6220
6235
fig , ax = plt .subplots ()
@@ -6275,18 +6290,3 @@ def test_polar_interpolation_steps_variable_r(fig_test, fig_ref):
6275
6290
l .get_path ()._interpolation_steps = 100
6276
6291
fig_ref .add_subplot (projection = "polar" ).plot (
6277
6292
np .linspace (0 , np .pi / 2 , 101 ), np .linspace (1 , 2 , 101 ))
6278
-
6279
-
6280
- def test_normalize_kwarg_warn_pie ():
6281
- fig , ax = plt .subplots ()
6282
- with pytest .warns (MatplotlibDeprecationWarning ):
6283
- ax .pie (x = [0 ], normalize = None )
6284
-
6285
-
6286
- def test_normalize_kwarg_pie ():
6287
- fig , ax = plt .subplots ()
6288
- x = [0.3 , 0.3 , 0.1 ]
6289
- t1 = ax .pie (x = x , normalize = True )
6290
- assert abs (t1 [0 ][- 1 ].theta2 - 360. ) < 1e-3
6291
- t2 = ax .pie (x = x , normalize = False )
6292
- assert abs (t2 [0 ][- 1 ].theta2 - 360. ) > 1e-3
0 commit comments