График

This commit is contained in:
2025-04-01 16:54:12 +03:00
parent 5b0f9f1904
commit d34d885762
3 changed files with 29 additions and 1 deletions

BIN
plot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

3
report/.gitignore vendored
View File

@@ -2,4 +2,5 @@
!.gitignore !.gitignore
!report.tex !report.tex
!img !img
!img/** !img/**
!plot.py

27
report/plot.py Normal file
View File

@@ -0,0 +1,27 @@
"""Код для рисования графика для отчёта."""
import matplotlib.pyplot as plt
plt.xlabel("Количество потоков в блоке", fontsize=18)
plt.ylabel("Время выполения, мс", fontsize=18)
plt.grid(True, which="both", linestyle="--", linewidth=0.5)
threads_per_block = [1, 10, 100, 1000]
# Тут указываем своё время
plt.plot(threads_per_block, [44648, 23257, 3643, 596], label="1 блок")
plt.plot(threads_per_block, [15096, 4075, 536, 88], label="10 блоков")
plt.plot(threads_per_block, [1694, 554, 93, 49], label="100 блоков")
plt.plot(threads_per_block, [1027, 291, 55, 64], label="1000 блоков")
plt.plot(threads_per_block, [1140, 223, 77, 196], label="10000 блоков")
# Тут указываем параметры оси Y (0, макс время, шаг)
# plt.yticks([i for i in range(0, 44648, 2500)])
# plt.xticks([i for i in range(0, 1000, 100)])
# Либо так, чтобы был логарифмический масштаб
plt.yscale("log")
plt.xscale("log")
plt.legend()
plt.show()