Skip to content

Commit c02bf7c

Browse files
committed
Explicitly specify the dtype in np.full
1 parent 9de15a0 commit c02bf7c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3978,7 +3978,7 @@ def dopatch(xs, ys, **kwargs):
39783978
# maybe draw the fliers
39793979
if showfliers:
39803980
# fliers coords
3981-
flier_x = np.full(len(stats['fliers']), pos)
3981+
flier_x = np.full(len(stats['fliers']), pos, dtype='float64')
39823982
flier_y = stats['fliers']
39833983

39843984
fliers.extend(doplot(

lib/matplotlib/hatch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def __init__(self, hatch, density):
169169
self.num_rows = (hatch.count('*')) * density
170170
path = Path.unit_regular_star(5)
171171
self.shape_vertices = path.vertices
172-
self.shape_codes = np.full(len(self.shape_vertices), Path.LINETO)
172+
self.shape_codes = np.full(len(self.shape_vertices), Path.LINETO,
173+
dtype='float64')
173174
self.shape_codes[0] = Path.MOVETO
174175
Shapes.__init__(self, hatch, density)
175176

lib/matplotlib/path.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ def interpolated(self, steps):
566566
vertices = simple_linear_interpolation(self.vertices, steps)
567567
codes = self.codes
568568
if codes is not None:
569-
new_codes = np.full(((len(codes) - 1) * steps + 1, ), Path.LINETO)
569+
new_codes = np.full(((len(codes) - 1) * steps + 1, ), Path.LINETO,
570+
dtype='float64')
570571
new_codes[0::steps] = codes
571572
else:
572573
new_codes = None
@@ -825,7 +826,7 @@ def unit_circle_righthalf(cls):
825826

826827
float)
827828

828-
codes = np.full(14, cls.CURVE4)
829+
codes = np.full(14, cls.CURVE4, dtype='float64')
829830
codes[0] = cls.MOVETO
830831
codes[-1] = cls.CLOSEPOLY
831832

0 commit comments

Comments
 (0)