You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除散点图中的红色阴影区域,仅保留红色线条?

解决方案

你只需要把生成红色阴影的fill_between代码替换成绘制两条红色线条的代码就行——fill_between是用来填充区域的,这就是你看到红色阴影的来源。

修改后的完整代码如下:

fig, ax = plt.subplots(figsize=(8, 8))

points = plt.scatter(df_new["aer"], df_new["mean"], c=z, s=20, cmap="Spectral_r") 

# 替换填充区域的代码为绘制上下边界线
plt.plot(df_new["aer"], df_new["aer"] - EE, color='red', alpha=0.3)
plt.plot(df_new["aer"], df_new["aer"] + EE, color='red', alpha=0.3)

ax.axline((0, 0), color='r', alpha=0.3, slope=1)

修改后,原有的红色填充区域会消失,只保留上下两条红色边界线条,不会再覆盖左上角的散点数据。

内容的提问来源于stack exchange,提问作者vanúcia Schumacher

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 13:50:25