Set the Z value of the grid lines

9 views
Skip to first unread message

JJ

unread,
Jun 19, 2024, 3:53:54 AM (yesterday) Jun 19
to pyqtgraph
I don't like the grid lines being displayed on top of the curves. What's the best way to solve this?

Is it possible to set the Z value of the grid lines in order to change this?

I've tried setting the z value of the curves to 1e6 but this doesn't make any difference.

Patrick

unread,
Jun 19, 2024, 10:09:57 PM (19 hours ago) Jun 19
to pyqtgraph
Hi,

I had a similar problem where ImageItems were drawn above the axis lines and tick marks, which I solved by changing the z value of the axes with
[ plot.getAxis(ax).setZValue(10) for ax in plot.axes ]
I believe that also affects the grid lines. You'll need to play with the value (try -1) to push the axes back in the stack behind the plot lines.

Alternatively, you could probably setZValue(100) on each of your PlotDataItems when you create them to stack them in front of everything else.

Patrick
Reply all
Reply to author
Forward
0 new messages