| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5a201dd commit de3a12f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -90,9 +90,9 @@ def load_data(data_file, field_idx0, field_idx1): | |||
| 90 | 90 | ||
| 91 | 91 | def random_marker(): | |
| 92 | 92 | markers = mks.MarkerStyle.markers | |
| 93 | - num = len(markers.values()) | ||
| 93 | + num = len(markers.keys()) | ||
| 94 | 94 | idx = random.randint(0, num - 1) | |
| 95 | - return markers.values()[idx] | ||
| 95 | + return markers.keys()[idx] | ||
| 96 | 96 | ||
| 97 | 97 | def get_data_label(path_to_log): | |
| 98 | 98 | 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): | |||
| 126 | 126 | plt.plot(data[0], data[1], label = label, color = color, | |
| 127 | 127 | linewidth = linewidth) | |
| 128 | 128 | 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) | ||
| 139 | 132 | legend_loc = get_legend_loc(chart_type) | |
| 140 | 133 | plt.legend(loc = legend_loc, ncol = 1) # ajust ncol to fit the space | |
| 141 | 134 | plt.title(get_chart_type_description(chart_type)) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments