0
A
回答
3
可以的Adpat在matplotlib event handling tutorial page的LineBuilder例如:
from matplotlib import pyplot as plt
class LineBuilder:
def __init__(self, line):
self.line = line
self.xs = list(line.get_xdata())
self.ys = list(line.get_ydata())
self.cid = line.figure.canvas.mpl_connect('button_press_event', self)
def __call__(self, event):
print('click', event)
if event.inaxes!=self.line.axes: return
self.xs.append(event.xdata)
self.ys.append(event.ydata)
self.line.set_data(self.xs, self.ys)
self.line.figure.canvas.draw()
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title('click to add points')
line, = ax.plot([], [], linestyle="none", marker="o", color="r")
linebuilder = LineBuilder(line)
plt.show()
相關問題
- 1. 使用鼠標作爲畫筆
- 2. 可以改變龜的筆畫嗎?
- 3. 筆畫可以用作SVG剪輯路徑的一部分嗎?
- 4. 圓形筆畫的筆畫動畫以完整筆畫結尾
- 5. 獲取點鼠標交互和畫筆一起工作
- 6. 在NativeDragDrop操作過程中可以設置鼠標光標嗎?
- 7. NSDockTile可以接受鼠標事件嗎?
- 8. qTip可以追蹤鼠標位置嗎?
- 9. 你可以強制鼠標移動嗎?
- 10. 我可以記錄鼠標移動嗎?
- 11. 在筆畫畫布中獲取鼠標位置
- 12. jquery.jeditable插件可以在鼠標點擊上工作嗎?
- 13. 可以將邊框/筆畫添加到Raphael圖像中嗎?
- 14. 動畫鼠標事件不起作用
- 15. Quadratics:替換鼠標點擊的鍵盤筆畫
- 16. 可以動畫嗎?
- 17. 使用帶鼠標類的MooseX模塊可以嗎?
- 18. 2圖鼠標運動matplotlib
- 19. Matplotlib - 鼠標提示懸停
- 20. Matplotlib捕獲錯誤的鼠標座標
- 21. 我可以用JS禁用水平鼠標滾動嗎?
- 22. 讓matplotlib動畫起作用
- 23. 冒號可以用作標識符嗎?
- 24. matplotlib中的動畫標題
- 25. D3在鼠標懸停時改變路徑筆畫顏色
- 26. 鼠標跟隨腳本,可以在懸停的動畫
- 27. 在matplotlib畫布上檢測相對鼠標位置
- 28. 在monkeyrunner中,鼠標和鍵盤都可以一次使用嗎?
- 29. 您可以使用SDL2跟蹤多個鼠標嗎?
- 30. 在Mayavi中可以用鼠標禁止軸旋轉嗎?