24
24
import
F438
span> matplotlib .font_manager as mfont_manager
25
25
import matplotlib .markers as mmarkers
26
26
import matplotlib .patches as mpatches
27
+ import matplotlib .path as mpath
27
28
import matplotlib .pyplot as plt
28
29
import matplotlib .ticker as mticker
29
30
import matplotlib .transforms as mtransforms
@@ -5119,7 +5120,7 @@ def test_pie_default():
5119
5120
5120
5121
5121
5122
@image_comparison (['pie_linewidth_0' , 'pie_linewidth_0' , 'pie_linewidth_0' ],
5122
- extensions = ['png' ])
5123
+ extensions = ['png' ], style = 'mpl20' )
5123
5124
def test_pie_linewidth_0 ():
5124
5125
# The slices will be ordered and plotted counter-clockwise.
5125
5126
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5151,7 +5152,7 @@ def test_pie_linewidth_0():
5151
5152
plt .axis ('equal' )
5152
5153
5153
5154
5154
- @image_comparison (['pie_center_radius.png' ])
5155
+ @image_comparison (['pie_center_radius.png' ], style = 'mpl20' )
5155
5156
def test_pie_center_radius ():
5156
5157
# The slices will be ordered and plotted counter-clockwise.
5157
5158
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5171,7 +5172,7 @@ def test_pie_center_radius():
5171
5172
plt .axis ('equal' )
5172
5173
5173
5174
5174
- @image_comparison (['pie_linewidth_2.png' ])
5175
+ @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' )
5175
5176
def test_pie_linewidth_2 ():
5176
5177
# The slices will be ordered and plotted counter-clockwise.
5177
5178
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5186,7 +5187,7 @@ def test_pie_linewidth_2():
5186
5187
plt .axis ('equal' )
5187
5188
5188
5189
5189
- @image_comparison (['pie_ccw_true.png' ])
5190
+ @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' )
5190
5191
def test_pie_ccw_true ():
5191
5192
# The slices will be ordered and plotted counter-clockwise.
5192
5193
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5201,7 +5202,7 @@ def test_pie_ccw_true():
5201
5202
plt .axis ('equal' )
5202
5203
5203
5204
5204
- @image_comparison (['pie_frame_grid.png' ])
5205
+ @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' )
5205
5206
def test_pie_frame_grid ():
5206
5207
# The slices will be ordered and plotted counter-clockwise.
5207
5208
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5228,7 +5229,7 @@ def test_pie_frame_grid():
5228
5229
plt .axis ('equal' )
5229
5230
5230
5231
5231
- @image_comparison (['pie_rotatelabels_true.png' ])
5232
+ @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' )
5232
5233
def test_pie_rotatelabels_true ():
5233
5234
# The slices will be ordered and plotted counter-clockwise.
5234
5235
labels = 'Hogwarts' , 'Frogs' , 'Dogs' , 'Logs'
@@ -7539,3 +7540,24 @@ def test_clim():
7539
7540
clim = (7 , 8 )
7540
7541
norm = plot_method (clim = clim ).norm
7541
7542
assert (norm .vmin , norm .vmax ) == clim
7543
+
7544
+
7545
+ def test_bezier_autoscale ():
7546
+ # Check that bezier curves autoscale to their curves, and not their
7547
+ # control points
7548
+ verts = [[- 1 , 0 ],
7549
+ [0 , - 1 ],
7550
+ [1 , 0 ],
7551
+ [1 , 0 ]]
7552
+ codes = [mpath .Path .MOVETO ,
7553
+ mpath .Path .CURVE3 ,
7554
+ mpath .Path .CURVE3 ,
7555
+ mpath .Path .CLOSEPOLY ]
7556
+ p = mpath .Path (verts , codes )
7557
+
7558
+ fig , ax = plt .subplots ()
7559
+ ax .add_patch (mpatches .PathPatch (p ))
7560
+ ax .autoscale ()
7561
+ # Bottom ylim should be at the edge of the curve (-0.5), and not include
7562
+ # the control point (at -1)
7563
+ assert ax .get_ylim ()[0 ] == - 0.5
0 commit comments