如何反转 PyQtGraph 中 ScatterPlotItem 的 Y 轴
我想用索引显示散点图中的点,就像它是一个矩阵一样,原点左上角反转 Y 轴:
0,0 1,0
0,1 1,1
而不是默认原点位于左下角。
0,1 1,1
0,0 1,0
我尝试过:
plot = pg.ScatterPlotItem(...)
plot.getViewBox().invertY(True) # view box is NoneType
按照此处的建议反转PyQtGraph 中的 Y 轴 没有运气。
I want to display points in a scatter plot with indices as if it were a matrix, origin top left inverting the Y axis:
0,0 1,0
0,1 1,1
instead of default where the origin is the lower left.
0,1 1,1
0,0 1,0
I tried:
plot = pg.ScatterPlotItem(...)
plot.getViewBox().invertY(True) # view box is NoneType
as suggested here Inverting the Y axis in PyQtGraph with no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参考官方 doc ,当您在轴内显示数据时,您会结束数据如图所示,使用
plotItem
对象为A 容器向上(直接或间接)。假设您绘制了以下内容:
您可以简单地做:
<
a href =“ https://i.sstatic.net/pttj8.png” rel =” nofollow noreferrer“>
Referring to the official doc, when you have data displayed within axes, you end up (directly or indirectly) using a
PlotItem
object as a container, as shown in the figure.Assuming you are plotting something like the following:
You can simply do:
And here is the result: