@@ -312,7 +312,7 @@ def make_compound_path_from_polys(cls, XY):
312
312
stride = numsides + 1
313
313
nverts = numpolys * stride
314
314
verts = np .zeros ((nverts , 2 ))
315
- codes = np .ones (nverts , int ) * cls .LINETO
315
+ codes = np .full (nverts , cls .LINETO , dtype = cls . code_type )
316
316
codes [0 ::stride ] = cls .MOVETO
317
317
codes [numsides ::stride ] = cls .CLOSEPOLY
318
318
for i in range (numsides ):
@@ -552,7 +552,8 @@ def interpolated(self, steps):
552
552
vertices = simple_linear_interpolation (self .vertices , steps )
553
553
codes = self .codes
554
554
if codes is not None :
555
- new_codes = Path .LINETO * np .ones (((len (codes ) - 1 ) * steps + 1 , ))
555
+ new_codes = np .full ((len (codes ) - 1 ) * steps + 1 , Path .LINETO ,
556
+ dtype = self .code_type )
556
557
new_codes [0 ::steps ] = codes
557
558
else :
558
559
new_codes = None
@@ -802,7 +803,7 @@ def unit_circle_righthalf(cls):
802
803
803
804
float )
804
805
805
- codes = cls .CURVE4 * np . ones ( 14 )
806
+ codes = np . full ( 14 , cls .CURVE4 , dtype = cls . code_type )
806
807
codes [0 ] = cls .MOVETO
807
808
codes [- 1 ] = cls .CLOSEPOLY
808
809
@@ -864,7 +865,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False):
864
865
if is_wedge :
865
866
length = n * 3 + 4
866
867
vertices = np .zeros ((length , 2 ), float )
867
- codes = cls . CURVE4 * np .ones (( length , ), cls .code_type )
868
+ codes = np .full ( length , cls . CURVE4 , dtype = cls .code_type )
868
869
vertices [1 ] = [xA [0 ], yA [0 ]]
869
870
codes [0 :2 ] = [cls .MOVETO , cls .LINETO ]
870
871
codes [- 2 :] = [cls .LINETO , cls .CLOSEPOLY ]
@@ -873,7 +874,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False):
873
874
else :
874
875
length = n * 3 + 1
875
876
vertices = np .empty ((length , 2 ), float )
876
- codes = cls . CURVE4 * np .ones (( length , ), cls .code_type )
877
+ codes = np .full ( length , cls . CURVE4 , dtype = cls .code_type )
877
878
vertices [0 ] = [xA [0 ], yA [0 ]]
878
879
codes [0 ] = cls .MOVETO
879
880
vertex_offset = 1
0 commit comments