【发布时间】:2016-11-22 12:45:27
【问题描述】:
我有两个数据框,ground_truth 和 prediction(都是熊猫系列)。最后,我想绘制所有 预测点 和所有 ground_truth 点,就像我已经做过的那样。我想做的是在每个预测和ground_truth 点之间画一条线。所以这条线是预测点 x1,y1 和 ground_truth 点 x2,y2 之间的连接。为了更好地理解,我附上了一张图片。黑线(通过油漆创建)是我想要做的。
这是我已经拥有的:
fig, ax = plt.subplots()
ax.plot(pred,'ro', label='Prediction', color = 'g')
ax.plot(GT,'^', label='Ground Truth', color = 'r' )
plt.xlabel('a')
plt.ylabel('b')
plt.title('test')
plt.xticks(np.arange(-1, 100, 5))
plt.style.use('ggplot')
plt.legend()
plt.show()
【问题讨论】:
标签: python matplotlib prediction