【发布时间】:2021-06-17 17:57:10
【问题描述】:
我正在尝试做这样的事情 (Draw a point at the mean peak of a distplot or kdeplot in Seaborn)。我需要用值 13.72 标记点。
但是: 列表索引超出范围
字符串:x = ax.lines[0].get_xdata()
int_rate = df['int_rate']
ax = sns.kdeplot(int_rate, shade = True)
x = ax.lines[0].get_xdata()
y = ax.lines[0].get_ydata()
maxid = np.where(x == 13.72)
plt.plot(x[maxid],y[maxid], 'bo', ms=10)
【问题讨论】: