@@ -793,7 +793,7 @@ def simplifyLine(fighandle, axhandle, linehandle, target_resolution):
793
793
numLines = np .size (lineStart )
794
794
795
795
# original_code : id_remove = cell(numLines, 1)
796
- id_remove = [[] * numLines ]
796
+ id_remove = [np . array ([], dtype = np . int32 ). reshape (( - 1 , ))] * numLines
797
797
798
798
# Simplify the line segments
799
799
for ii in np .arange (numLines ):
@@ -804,15 +804,13 @@ def simplifyLine(fighandle, axhandle, linehandle, target_resolution):
804
804
# Line simplification
805
805
if np .size (x ) > 2 :
806
806
mask = opheimSimplify (x , y , tol )
807
- id_remove [ii ] = np .argwhere (mask == 0 ) + lineStart [ii ]
807
+ id_remove [ii ] = np .argwhere (mask == 0 ). reshape (( - 1 , )) + lineStart [ii ]
808
808
# Merge the indices of the line segments
809
809
# original code : id_remove = cat(1, id_remove{:})
810
810
id_remove = np .concatenate (id_remove )
811
811
812
812
# remove the data points
813
- data = removeData (data , id_remove )
814
- linehandle .set_xdata (data [:, 0 ])
815
- linehandle .set_ydata (data [:, 1 ])
813
+ removeData (linehandle , id_remove )
816
814
817
815
818
816
def simplifyStairs (fighandle , axhandle , linehandle ):
0 commit comments