Exporting only with gradient of HistogramLUTItem

29 views
Skip to first unread message

Luka Drmic

unread,
Aug 10, 2018, 6:29:38 AM8/10/18
to pyqtgraph
So i want to export some graphs as png, but i would like it to have only the main graph and gradient item of the histogramLUTitem. Pretty much what matplotlib does. Have my main graph (image) and on the side have my gradient edit item with values next to it.

I tried hiding everything except the gradient item but that leaves me with two lines that ure used to slide along axis of LUT item, and in addition to that it removes axis values, and i wouold like to keep those.

hideAll.png









Desired items on the export png:

Desired.png


Patrick

unread,
Aug 12, 2018, 11:48:08 PM8/12/18
to pyqtgraph
Perhaps you could use a GradientLegend (http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/GradientLegend.html#GradientLegend) and set its gradient and labels to those of the HistogramLUTItem. If you're exporting the graph, you may need to do some trickery, like hide/remove the HistogramLUTItem and replace it with the GradientLegend, do the export, then put the HistogramLUTItem back. Or if you don't care about the histogram and editing the gradient, just stick with the GradientLegend.
Reply all
Reply to author
Forward
0 new messages