feat: 基本画完,缺乏大小标尺
Browse files
experiments/performance_comparison.py
CHANGED
@@ -78,7 +78,7 @@ for category in df['Category'].unique():
|
|
78 |
# 动态轴范围计算
|
79 |
data_min = (df['RMSE'] - df['Uncertainty']).min()
|
80 |
x_min = max(data_min - 0.05, 0) # 保证最小值不低于0
|
81 |
-
x_max = 1
|
82 |
|
83 |
# 专业级布局配置
|
84 |
fig.update_layout(
|
@@ -130,40 +130,43 @@ for idx, method in enumerate(df['Method']):
|
|
130 |
)
|
131 |
|
132 |
# 添加专业级尺寸图例系统
|
133 |
-
size_legend_values = [1e3, 1e4, 1e5, 1e6] # 定义标准参数规模
|
134 |
-
size_legend_sizes = 15 + 25 * (np.log(size_legend_values) - size_min) / (size_max - size_min)
|
135 |
-
|
136 |
-
fig.add_trace(go.Scatter(
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
|
|
|
|
161 |
|
162 |
# 添加最终标注
|
163 |
fig.add_annotation(
|
164 |
x=0.98, y=0.02,
|
165 |
xref='paper', yref='paper',
|
166 |
-
text='
|
167 |
showarrow=False,
|
168 |
font=dict(size=10, color='#666666'),
|
169 |
bgcolor='white'
|
|
|
78 |
# 动态轴范围计算
|
79 |
data_min = (df['RMSE'] - df['Uncertainty']).min()
|
80 |
x_min = max(data_min - 0.05, 0) # 保证最小值不低于0
|
81 |
+
x_max = min(df['RMSE'].max() + df['Uncertainty'].max(), 1) # 保证最大值不超过1
|
82 |
|
83 |
# 专业级布局配置
|
84 |
fig.update_layout(
|
|
|
130 |
)
|
131 |
|
132 |
# 添加专业级尺寸图例系统
|
133 |
+
# size_legend_values = [1e3, 1e4, 1e5, 1e6] # 定义标准参数规模
|
134 |
+
# size_legend_sizes = 15 + 25 * (np.log(size_legend_values) - size_min) / (size_max - size_min)
|
135 |
+
|
136 |
+
# fig.add_trace(go.Scatter(
|
137 |
+
# x=[0.52, 0.55, 0.58, 0.61],
|
138 |
+
# y=np.array([0.00, 0.05, 0.10, 0.15]),
|
139 |
+
# mode='markers',
|
140 |
+
# marker=dict(
|
141 |
+
# size=size_legend_sizes,
|
142 |
+
# color='#444444',
|
143 |
+
# opacity=0.8
|
144 |
+
# ),
|
145 |
+
# showlegend=False,
|
146 |
+
# text=[f'{size:.2e}' for size in size_legend_values],
|
147 |
+
# ))
|
148 |
+
|
149 |
+
# # 添加尺寸图例标注
|
150 |
+
# size_labels = ['1K', '10K', '100K', '1M']
|
151 |
+
# for i, (x, y, label) in enumerate(zip([0.95]*4, [0.15,0.20,0.25,0.30], size_labels)):
|
152 |
+
# fig.add_annotation(
|
153 |
+
# x=x,
|
154 |
+
# y=y,
|
155 |
+
# xref="paper",
|
156 |
+
# yref="paper",
|
157 |
+
# text=label,
|
158 |
+
# showarrow=False,
|
159 |
+
# font=dict(size=10),
|
160 |
+
# xanchor='left'
|
161 |
+
# )
|
162 |
+
|
163 |
+
# | Parameters (log scale)
|
164 |
|
165 |
# 添加最终标注
|
166 |
fig.add_annotation(
|
167 |
x=0.98, y=0.02,
|
168 |
xref='paper', yref='paper',
|
169 |
+
text='叶璨铭绘制',
|
170 |
showarrow=False,
|
171 |
font=dict(size=10, color='#666666'),
|
172 |
bgcolor='white'
|