ImageItem drawn on top of plot hides elements of the plot.

36 views
Skip to first unread message

Luka Drmic

unread,
Feb 18, 2019, 11:41:58 AM2/18/19
to pyqtgraph
        frame_layout = pg.GraphicsLayout()
        main_subplot
= frame_layout.addPlot()
        img
= pg.ImageItem()
        img
.setImage(self.displayed_data_set, padding=0)

Setting an image item in the plot area with 0 padding hides axis and ticks. Additionaly if grid is turned on it is not visible, as if the image item is "on top" of the plot and it covers all of the elements of the plot item.
If i set the style of ticks to points towards the text, then they are visible, but this is not the behaviour i want.

I have only tried one thing which is

        main_subplot.setZValue(1000)

After that I really had no idea what to try so i came here for help.


Thanks, Luka.

Patrick

unread,
Feb 18, 2019, 9:21:47 PM2/18/19
to pyqtgraph
Hi,

I solved this issue with something like this, hopefully it works for you:

self.overview = self.overview_graphicsLayoutWidget.addPlot()
[ self.overview.getAxis(ax).setZValue(10) for ax in self.overview.axes ] # Draw axes and ticks above image/data

Patrick

Luka Drmic

unread,
Feb 19, 2019, 8:49:59 AM2/19/19
to pyqtgraph
Thank you sir, that did the job.
Reply all
Reply to author
Forward
0 new messages