polarrcnn-thesis/thesis_figure/anchor_num/anchor_num_testing.py
2024-10-30 13:14:09 +08:00

47 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import matplotlib.pyplot as plt
import matplotlib as mpl
# 设置全局字体为 Times New Roman
mpl.rcParams['font.family'] = 'Times New Roman'
mpl.rcParams['font.serif'] = ['Times New Roman']
mpl.rcParams['axes.titlesize'] = 18
mpl.rcParams['axes.labelsize'] = 30
mpl.rcParams['xtick.labelsize'] = 22
mpl.rcParams['ytick.labelsize'] = 22
mpl.rcParams['legend.fontsize'] = 22
alpha = 0.7
plt.figure(figsize=(8.5, 8))
# 2×7
x_2x7 = [10, 14]
y_2x7 = [80.075, 80.083]
plt.plot(x_2x7, y_2x7, 'o-', color='blue', alpha=alpha, markersize=12, linewidth=4, label="2×7")
# 2×10
x_2x10 = [10, 15, 20]
y_2x10 = [80.549, 80.585, 80.59]
plt.plot(x_2x10, y_2x10, 's-', color='green', alpha=alpha, markersize=12, linewidth=4, label="2×10")
# 4×10
x_4x10 = [10, 15, 20, 25, 30, 35, 40]
y_4x10 = [80.3, 80.824, 80.805, 80.799, 80.798, 80.796, 80.794]
plt.plot(x_4x10, y_4x10, 'd-', color='red', alpha=alpha, markersize=12, linewidth=4, label="4×10")
# 5×12
x_5x12 = [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60]
y_5x12 = [79.742, 80.809, 80.9, 80.924, 80.919, 80.92, 80.921, 80.924, 80.923, 80.923, 80.924]
plt.plot(x_5x12, y_5x12, 'v-', color='purple', alpha=alpha, markersize=12, linewidth=4, label="5×12")
# 6×18
x_6x13 = [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 78]
y_6x13 = [78.576, 80.53, 80.907, 80.953, 80.955, 80.958, 80.956, 80.958, 80.963, 80.965, 80.962, 80.962, 80.962, 80.962]
plt.plot(x_6x13, y_6x13, 'p-', color='orange', alpha=alpha, markersize=12, linewidth=4, label="6×13")
plt.grid(True, linestyle='-', alpha=0.5)
plt.xlabel("Anchor Proposal Number", fontsize=30) # 横坐标名字
plt.ylabel("F1@50 (%)", fontsize=30) # 纵坐标名字
plt.legend(loc="lower right", title="Polar Map Size", title_fontsize=mpl.rcParams['legend.fontsize']) # 图例标题
plt.savefig('anchor_num_testing.png', dpi=300)
plt.show()