【发布时间】:2019-04-30 00:09:16
【问题描述】:
如果我有这样的 MWE 散点图:
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(5)
fig = plt.figure()
ax = fig.add_subplot(111)
xlist = []
ylist = []
for i in range(500):
x = np.random.normal(100)
xlist.append(x)
y = np.random.normal(5)
ylist.append(y)
x_ave = np.average(x)
y_ave = np.average(y)
plt.scatter(xlist, ylist)
plt.scatter(x_ave, y_ave, c = 'red', marker = '*', s = 50)
在情节上绘制“平均点”(有合适的词吗?)的最简单方法是什么?我发现的所有教程和示例都显示了如何绘制最佳拟合线,但我只想要单点。
绘图 (x_ave, y_ave) 有效,但有没有更好的方法,特别是因为我最终也想用误差线显示标准偏差?
【问题讨论】:
标签: python matplotlib scatter-plot