(I am new to GUI programming; experienced programmer otherwise)
(我是GUI编程的新手;否则经验丰富的程序员)
(Using wxPython; but generic advice welcome)
(使用wxPython;但欢迎通用建议)
I am looking for advice / direction on implementing a widget that can do area selection on a plot. Any pointers from experienced users would be much appreciated.
我正在寻找关于实现可以在绘图上进行区域选择的小部件的建议/方向。任何有经验的用户的指针将非常感激。
What needs to be done is:
需要做的是:
- Implement a two dimensional plot.
- Implement a resizeable square that can be moved around to select an area on the plot.
- Report the plot points that fall within that area.
实现二维图。
实现可调整的方块,可以移动以选择绘图上的区域。
报告该区域内的情节点。
I realize that given the coordinates of the square and a sorted list of plot points, the contained plot points are easy to compute. I am just not sure of the widgets / graphics techniques to use to implement the plot itself and the resizeable square.
我意识到,给定方形的坐标和绘图点的排序列表,包含的绘图点很容易计算。我只是不确定用于实现绘图本身和可调整大小的方块的小部件/图形技术。
Thanks for any help!
谢谢你的帮助!
1 个解决方案
#1
For points 1 and 2 you could try WxMpl :
对于第1点和第2点,您可以尝试使用WxMpl:
http://agni.phys.iit.edu/~kmcivor/wxmpl/
It's a module for matplolib embedding in wxPython. Zooming in/out works out of the box.
它是在wxPython中嵌入matplolib的模块。放大/缩小开箱即用。
#1
For points 1 and 2 you could try WxMpl :
对于第1点和第2点,您可以尝试使用WxMpl:
http://agni.phys.iit.edu/~kmcivor/wxmpl/
It's a module for matplolib embedding in wxPython. Zooming in/out works out of the box.
它是在wxPython中嵌入matplolib的模块。放大/缩小开箱即用。