@@ -90,9 +90,9 @@ def load_data(data_file, field_idx0, field_idx1):
9090
9191def random_marker ():
9292 markers = mks .MarkerStyle .markers
93- num = len (markers .values ())
93+ num = len (markers .keys ())
9494 idx = random .randint (0 , num - 1 )
95- return markers .values ()[idx ]
95+ return markers .keys ()[idx ]
9696
9797def get_data_label (path_to_log ):
9898 label = path_to_log [path_to_log .rfind ('/' )+ 1 : path_to_log .rfind (
@@ -126,16 +126,9 @@ def plot_chart(chart_type, path_to_png, path_to_log_list):
126126 plt .plot (data [0 ], data [1 ], label = label , color = color ,
127127 linewidth = linewidth )
128128 else :
129- ok = False
130- ## Some markers throw ValueError: Unrecognized marker style
131- while not ok :
132- try :
133- marker = random_marker ()
134- plt .plot (data [0 ], data [1 ], label = label , color = color ,
135- marker = marker , linewidth = linewidth )
136- ok = True
137- except :
138- pass
129+ marker = random_marker ()
130+ plt .plot (data [0 ], data [1 ], label = label , color = color ,
131+ marker = marker , linewidth = linewidth )
139132 legend_loc = get_legend_loc (chart_type )
140133 plt .legend (loc = legend_loc , ncol = 1 ) # ajust ncol to fit the space
141134 plt .title (get_chart_type_description (chart_type ))
0 commit comments