最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - HistogramLUTWidget with PyQtGraph - Stack Overflow

programmeradmin4浏览0评论

I'm trying to make a representation of a RTL-SDR capture. I can show a couple of graphs, spectrum and waterfall with their histogram. The problem is that the histogram auto-adjusts the levels. I would like to avoid this auto-adjustment and I've tried everything. It's possible that it's a PyQtGraph bug.

# Waterfall
self.waterfall = pg.PlotWidget()
self.waterfall_image = pg.ImageItem()
self.waterfall_image.setOpts(axisOrder='row-major')
self.waterfall.addItem(self.waterfall_image)
self.waterfall.setMouseEnabled(x=False, y=False)
self.waterfall.getPlotItem().showAxes(False)
# Histogram
histogram = pg.HistogramLUTWidget()
histogram.setHistogramRange(0, 255)
histogram.setImageItem(self.waterfall_image)
histogram.item.gradient.loadPreset('viridis')

The versions I have are:

  • pyqtgraph==0.13.7

  • PySide6==6.8.2

I have tried to use without success:

self.waterfall_image.setLevels((0,255))

and

histogram.vb.enableAutoRange(enable=False)

By dragging the histogram levels with the mouse, it quickly returns to how it was.

发布评论

评论列表(0)

  1. 暂无评论