|
@@ -39,6 +39,7 @@ def put_analysis_report_to_html(args, df_clean, df_predict, df_accuracy):
|
|
|
total_size = df_clean.shape[0]
|
|
|
clean_size = total_size
|
|
|
if 'is_limit' in df_clean.columns:
|
|
|
+ df_clean['is_limit'] = df_clean['is_limit'].apply(lambda x: '正常点' if x==0 else '异常点')
|
|
|
clean_size = df_clean[df_clean['is_limit']==False].shape[0]
|
|
|
df_overview = pd.DataFrame(
|
|
|
{'场站编码':[farmId],
|
|
@@ -53,24 +54,38 @@ def put_analysis_report_to_html(args, df_clean, df_predict, df_accuracy):
|
|
|
|
|
|
# -------------------- 实测气象与实际功率散点图--------------------
|
|
|
|
|
|
- # 生成实际功率与辐照度的散点图
|
|
|
fig_scatter = px.scatter(df_clean, x=col_x_env, y=label, color='is_limit')
|
|
|
- # fig_scatter = px.scatter(df_clean, x=col_x_env, y=label)
|
|
|
+
|
|
|
# 自定义散点图布局
|
|
|
fig_scatter.update_layout(
|
|
|
- template='seaborn',
|
|
|
- plot_bgcolor='rgba(255, 255, 255, 0.8)', # 背景色
|
|
|
+ template='seaborn', # 使用 seaborn 风格
|
|
|
+ plot_bgcolor='rgba(255, 255, 255, 0.8)', # 背景色(淡白色)
|
|
|
xaxis=dict(
|
|
|
- showgrid=True,
|
|
|
- gridcolor='rgba(200, 200, 200, 0.5)',
|
|
|
- title=col_x_env
|
|
|
+ showgrid=True, # 显示网格
|
|
|
+ gridcolor='rgba(200, 200, 200, 0.5)', # 网格线颜色(淡灰色)
|
|
|
+ title=col_x_env, # x 轴标题
|
|
|
+ title_font=dict(size=14), # x 轴标题字体大小
|
|
|
+ tickfont=dict(size=12) # x 轴刻度标签字体大小
|
|
|
),
|
|
|
yaxis=dict(
|
|
|
- showgrid=True,
|
|
|
- gridcolor='rgba(200, 200, 200, 0.5)',
|
|
|
- title=label
|
|
|
+ showgrid=True, # 显示网格
|
|
|
+ gridcolor='rgba(200, 200, 200, 0.5)', # 网格线颜色(淡灰色)
|
|
|
+ title=label, # y 轴标题
|
|
|
+ title_font=dict(size=14), # y 轴标题字体大小
|
|
|
+ tickfont=dict(size=12) # y 轴刻度标签字体大小
|
|
|
+ ),
|
|
|
+ legend=dict(
|
|
|
+ x=0.01, y=0.99, # 图例位置
|
|
|
+ bgcolor='rgba(255, 255, 255, 0.7)', # 图例背景色
|
|
|
+ bordercolor='black', # 图例边框颜色
|
|
|
+ borderwidth=1, # 图例边框宽度
|
|
|
+ font=dict(size=12) # 图例文字大小
|
|
|
+ ),
|
|
|
+ title=dict(
|
|
|
+ text='实际功率与辐照度的散点图', # 图表标题
|
|
|
+ x=0.5, # 标题居中
|
|
|
+ font=dict(size=16) # 标题字体大小
|
|
|
),
|
|
|
- legend=dict(x=0.01, y=0.99, bgcolor='rgba(255, 255, 255, 0.7)', bordercolor='black', borderwidth=1)
|
|
|
)
|
|
|
|
|
|
# 将散点图保存为 HTML 片段
|