У меня есть список словарей, которые я извлекаю из набора регулярных выражений. Я строю результаты для каждого словаря, используя одну и ту же функцию и зацикливая только имя регулярного выражения:
def plot_Node_Own_Synchronization_signals_List(Log_File):
for regular_expression_key in Node_Own_Synchronization.keys():
#file = open('/home/data/Signal_Synchronization_Statistics/' + str(regular_expression_key) + '.txt', 'w')
print('regular_expression_key= ' + str(regular_expression_key))
#file.write('regular_expression_key= ' + str(regular_expression_key) + '\n')
re_value = Node_Own_Synchronization[regular_expression_key]
print('re_value= ' + str(re_value))
#file.write('re_value= ' + str(re_value) + '\n')
dict_node_info = loadInfoFrom_Node_Own_Synchronization_signals_List(Log_File, re_value)
print('dict_node_info= ' + str(dict_node_info))
#file.write('dict_node_info= ' + str(dict_node_info) + '\n')
#file.close()
if (bool(dict_node_info) == False):
print('I am empty')
else:
f = plt.figure(1)
legend = []
for mac, dico_data in dict_node_info.items():
legend.append(mac)
plt.plot(dico_data['timestamp'], dico_data['Counter'])
plt.xlabel('Time (s)')
plt.ylabel(regular_expression_key)
plt.title('signal_synchronization_variation:' + str(regular_expression_key))
legend_x = 1
legend_y = 0.5
legend = plt.legend(legend, loc='center left', bbox_to_anchor=(legend_x, legend_y), prop={'size': 6})
for legend_handle in legend.legendHandles:
legend_handle._legmarker.set_markersize(9)
plt.grid(True)
f.savefig("/home/data/Signal_Synchronization_Traces/Own_Synchronization_signal_" + str(regular_expression_key) + "-" + str(date.today()) + ".png", bbox_inches='tight')
Проблема в том, что с каждым новым исполнением у меня разный масштаб для моей фигуры. Иногда разные кривые появляются для одного и того же набора данных.


Как я могу починить весы, пожалуйста? Мне нужно сравнить данные.