@@ -312,7 +312,7 @@ def make_compound_path_from_polys(cls, XY):
312312 stride = numsides + 1
313313 nverts = numpolys * stride
314314 verts = np .zeros ((nverts , 2 ))
315- codes = np .ones (nverts , int ) * cls .LINETO
315+ codes = np .full (nverts , cls .LINETO , dtype = int )
316316 codes [0 ::stride ] = cls .MOVETO
317317 codes [numsides ::stride ] = cls .CLOSEPOLY
318318 for i in range (numsides ):
@@ -552,7 +552,7 @@ def interpolated(self, steps):
552552 vertices = simple_linear_interpolation (self .vertices , steps )
553553 codes = self .codes
554554 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 )
556556 new_codes [0 ::steps ] = codes
557557 else :
558558 new_codes = None
@@ -802,7 +802,7 @@ def unit_circle_righthalf(cls):
802802
803803 float )
804804
805- codes = cls . CURVE4 * np .ones (14 )
805+ codes = np .full (14 , cls . CURVE4 )
806806 codes [0 ] = cls .MOVETO
807807 codes [- 1 ] = cls .CLOSEPOLY
808808
@@ -864,7 +864,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False):
864864 if is_wedge :
865865 length = n * 3 + 4
866866 vertices = np .zeros ((length , 2 ), float )
867- codes = cls . CURVE4 * np .ones ((length , ), cls .code_type )
867+ codes = np .full ((length , ), cls . CURVE4 , dtype = cls .code_type )
868868 vertices [1 ] = [xA [0 ], yA [0 ]]
869869 codes [0 :2 ] = [cls .MOVETO , cls .LINETO ]
870870 codes [- 2 :] = [cls .LINETO , cls .CLOSEPOLY ]
@@ -873,7 +873,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False):
873873 else :
874874 length = n * 3 + 1
875875 vertices = np .empty ((length , 2 ), float )
876- codes = cls . CURVE4 * np .ones ((length , ), cls .code_type )
876+ codes = np .full ((length , ), cls . CURVE4 , dtype = cls .code_type )
877877 vertices [0 ] = [xA [0 ], yA [0 ]]
878878 codes [0 ] = cls .MOVETO
879879 vertex_offset = 1
0 commit comments