diff --git a/plot.png b/plot.png new file mode 100644 index 0000000..b92cfbd Binary files /dev/null and b/plot.png differ diff --git a/report/.gitignore b/report/.gitignore index 38a3719..1186ad7 100644 --- a/report/.gitignore +++ b/report/.gitignore @@ -2,4 +2,5 @@ !.gitignore !report.tex !img -!img/** \ No newline at end of file +!img/** +!plot.py \ No newline at end of file diff --git a/report/plot.py b/report/plot.py new file mode 100644 index 0000000..274ec63 --- /dev/null +++ b/report/plot.py @@ -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()