I am trying to use ax.fill_between
to plot the area under a curve, but for some odd reason, one curve gets plotted just fine, and the other one isn't, what goes wrong?
(我正在尝试使用ax.fill_between
绘制曲线下的面积,但是由于某些奇怪的原因,一条曲线被绘制得很好,而另一条曲线却没有,这是怎么回事?)
Code:
(码:)
_, ax = plt.subplots(figsize=(9, 7))
sns.lineplot(x1, y1)
ax.fill_between(x1, y1, alpha=0.3)
sns.lineplot(x2, y2)
ax.fill_between(x2, y2, alpha=0.3)
Result:
(结果:)
I've tried also ax.fill_between(x2, y2, 0, alpha=0.3)
and ax.fill_between(x2, 0, y2, alpha=0.3)
but I get the same plot.
(我也尝试过ax.fill_between(x2, y2, 0, alpha=0.3)
和ax.fill_between(x2, 0, y2, alpha=0.3)
但我得到了相同的图。)
ask by bluesummers translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…