Draw axes passing through the origin

12 views
Skip to first unread message

Andrea Cogliati

unread,
Apr 21, 2021, 8:47:23 AM4/21/21
to pyqtgraph
I'd like to display a scatter plot with axes passing through the origin, which is in the center of the plot. This is how I setup the plot:

plotWidget = pg.plot(title="Sensor position")
scatter_plot = pg.ScatterPlotItem()
scatter_plot.setData(pos=pos)
plotWidget.addItem(scatter_plot)
plotWidget.setRange(xRange=(-2.0,2.0), yRange=(-2.0,2.0))

It looks like that an AxisItem can only be positioned at ‘left’, ‘right’, ‘top’, or ‘bottom’ positions. Are there alternatives?
Reply all
Reply to author
Forward
0 new messages