gpt4 book ai didi

python - 在pyqtgraph的ImageView中设置X和Y范围

转载 作者:行者123 更新时间:2023-12-01 07:26:28 25 4
gpt4 key购买 nike

有没有办法通过代码设置pyqtgraph ImageView的X和Y范围?在 GUI 程序中的 ImageView 上单击鼠标右键,可以选择设置 X 轴和 Y 轴。但是,在文档 API 引用中 ImageView没有提及如何设置X-Y范围。

enter image description here

最佳答案

我认为您正在寻找 setLimits()来限制视野范围。您可以使用 xMinxMaxyMinyMax 设置 x 轴和 y 轴的最小/最大范围>

plot_widget = pg.PlotWidget()
plot_widget.setLimits(xMin=1, xMax=5, yMin=0, yMax=100)

例如

plot_widget.setLimits(xMin=0, xMax=.5, yMin=0, yMax=400)

并与

plot_widget.setLimits(xMin=.2, xMax=.3, yMin=0, yMax=125)

关于python - 在pyqtgraph的ImageView中设置X和Y范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57420631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com