Consider the following matplotlib example: https://matplotlib.org/3.1.1/gallery/recipes/fill_between_alpha.html
(考虑以下matplotlib示例: https ://matplotlib.org/3.1.1/gallery/recipes/fill_between_alpha.html)
With fill_between
it can show a standard deviation:
(使用fill_between
它可以显示标准偏差:)
ax.fill_between(t, mu1+sigma1, mu1-sigma1, facecolor='blue', alpha=0.5)
However, the area is filled uniformly, while the actual distribution is normal for each x-coordinate (I think).
(但是,该区域被均匀填充,而每个x坐标的实际分布是??正态的(我认为)。)
Is it possible to fill the area to reflect it (so that the color is the denser the closer the point is to mu1
). (是否可以填充该区域以反映该区域(以使颜色越靠近该点, mu1
)。)
You can assume that I have arrays mean
and std
, which define a normal distribution for each x-coordinate, and I want to draw these distributions: alpha
should be proportional to density.
(您可以假设我有mean
和std
数组,它们为每个x坐标定义了一个正态分布,并且我想绘制这些分布: alpha
应该与密度成比例。)
As a solution, I can probably use several layers of fill_between
, but it's not precise and is very hacky.
(作为解决方案,我可能可以使用几层fill_between
,但这并不精确,而且很hacky。)
ask by aaa translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…