【问题标题】:How to fix graphic -- shaded area on scatter plot lines如何修复图形——散点图线上的阴影区域
【发布时间】:2023-02-03 02:07:41
【问题描述】:

我想从散点图中删除红色阴影区域(在左角的点上方)。我只想要红线。有人可以帮助我吗?

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

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

plt.fill_between(df_new["aer"], df_new["aer"] - EE, df_new["aer"] + EE, color='red', alpha=0.3)

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

【问题讨论】:

    标签: python matplotlib scatter-plot


    【解决方案1】:

    plt.fill_between 函数在两条外线之间创建阴影。您可以改为跟踪两行:

    plt.plot(df_new["aero_AOT550"], df_new["aero_AOT550"] - EE, color='red', alpha=0.3)
    plt.plot(df_new["aero_AOT550"], df_new["aero_AOT550"] + EE, color='red', alpha=0.3)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-24
      • 2012-09-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多