【发布时间】:2026-01-23 20:30:02
【问题描述】:
我有一系列使用以下 Python (2.7) 代码生成的图像:
import numpy as np
import pyqtgraph as pg
data = np.ones((230,10,10)) #for example; not quite the data that resulted in this image, but the numbers themselves are not the focus
img = pg.image(data)
pg.QtGui.QApplication.exec_()
如何从底部图中获取相应的“x”值?另外,如何从上图中的每个正方形中获取对应的(x,y)坐标?
* 上的各种答案都集中在“ImageView”上,但如果可以的话,我会尽量避免它——由于某种原因,我无法用 ImageView 生成类似的图——没有任何结果,Python 只是冻结。我也是 PyQtGraph 的新手。
【问题讨论】:
-
请澄清您的问题,您到底想要什么?
-
能够将鼠标悬停在图(网格图或图形图)上并获得相应的坐标。
标签: python python-2.7 numpy pyqtgraph