如何将这些点与折线连接起来?我必须按顺序连接它们,以便点x = 1的y值连接点x = 2的y值,依此类推。还是可以以某种方式组合这些单独的图?
SELECT pm.receiver, pm.date_sent, pm.unread,
user_receiver.username AS receiver_name,
user_receiver.avatar AS receiver_avatar,
user_receiver.session_id AS receiver_session_id,
user_sender.username AS sender_name,
user_sender.avatar AS sender_avatar,
user_sender.session_id AS sender_session_id
FROM pm
INNER JOIN users AS user_receiver ON pm.receiver = user_receiver.id
INNER JOIN users AS user_sender ON pm.sender = user_sender.id
WHERE sender = :id OR receiver = :id
ORDER BY date_sent ASC
答案 0 :(得分:0)
您快到了!
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.plot(x[y>=0],pos, 'rs')
ax.plot(x[y<0],neg, 'bo')
ax.plot(x[y>=0],pos, 'red')
ax.plot(x[y<0],neg, 'blue')
plt.show()
这将连接点-您可以根据需要向artist
分别添加任意数量的ax
。每个plot
都会创建一个艺术家。
答案 1 :(得分:0)