This commit is contained in:
2026-10-31 23:39:24 +02:00
parent 6331be6412
commit f520135545
+2 -32
View File
@@ -1,16 +1,8 @@
#import numpy as np
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
for i in range(1, 4): for i in range(1, 4):
exec(f"data{i} = list(zip(*[x for x in [[float(j) for j in k.strip().split(',')] for k in open(\"data{i}.csv\").read().split(\"\\n\")[1:] if k] if x[1] <= 1200]))") exec(f"data{i} = list(zip(*[x for x in [[float(j) for j in k.strip().split(',')] for k in open(\"data{i}.csv\").read().split(\"\\n\")[1:] if k] if x[1] <= 1200]))")
'''
print(data1)
print(data2)
print(data3)
'''
'''
for i in range(5): for i in range(5):
title = "S,D,D_avg,T,C".split(',')[i] title = "S,D,D_avg,T,C".split(',')[i]
plt.cla() plt.cla()
@@ -22,9 +14,8 @@ for i in range(5):
plt.legend(labels = ["Кільце", "Дерево", "Решітка"]) plt.legend(labels = ["Кільце", "Дерево", "Решітка"])
plt.xlim(0, 1100) plt.xlim(0, 1100)
plt.tight_layout() plt.tight_layout()
plt.show() #plt.show()
#plt.savefig(f"diagram-{title}.svg", format = 'svg') plt.savefig(f"diagram-{title}.svg", format = 'svg')
'''
splits = 0, 55, 240, 1100 splits = 0, 55, 240, 1100
@@ -53,13 +44,6 @@ for i in range(3):
t = [] t = []
for v in vals: for v in vals:
m = min(v) m = min(v)
# if (m < 1.0):
# v = [(2 - x) for x in v]
# m = min(v)
#
# t.append([x / m for x in v])
# print([round(x, 5) for x in t[-1]])
# else:
t.append([x / m for x in v]) t.append([x / m for x in v])
print([round(x, 5) for x in t[-1]]) print([round(x, 5) for x in t[-1]])
@@ -76,13 +60,6 @@ for i in range(3):
vsss.append(vss) vsss.append(vss)
#tsas = []
#colors = ['#1133FF', '#22DD33', '#EE6611']
#for i, c in zip(zip(*smas), colors):
#tsas += i
# plt.grouped_bar([f"Діапазон {i+1}" for i in range(3)], i, color = c)
#tsas = tuple(zip(*smas))
dsas = {i:v for i, v in zip([f"Діапазон {i+1}" for i in range(3)], smas)} dsas = {i:v for i, v in zip([f"Діапазон {i+1}" for i in range(3)], smas)}
print(dsas) print(dsas)
plt.cla() plt.cla()
@@ -92,10 +69,3 @@ plt.legend()
plt.tight_layout() plt.tight_layout()
#plt.show() #plt.show()
plt.savefig("histogram.svg", format = "svg") plt.savefig("histogram.svg", format = "svg")
#plt.grouped_bar({i:v for i, v in zip([f"Діапазон {i+1}" for i in range(3)], smas)}, colors = colors)
#plt.show()
#print(tsas)