Skip to content

ColorBarItem lower axis value stuck #2102

@pijyoi

Description

@pijyoi

Short description

After dragging lower handle down till lower limit is hit on the axis, dragging it up no longer shifts the axis values.

Code to reproduce

  1. Run the following script
  2. Drag the lower handle downwards. The axis lower bound gets locked at -0.2.
  3. Drag the lower handle upwards. The axis lower bound stays locked at -0.2.
import pyqtgraph as pg
import numpy as np

pg.mkQApp()

pw = pg.PlotWidget()
pw.show()
imgitem = pg.ImageItem(axisOrder='row-major')
pw.addItem(imgitem)
xy = np.linspace(-3, 3, 1000)
data = np.sinc(xy)[:,None] * np.sinc(xy)
cmap = pg.colormap.get('viridis')
limits = data.min(), data.max()
bar = pg.ColorBarItem(values=limits, colorMap=cmap, limits=limits, rounding=0.1)
bar.setImageItem(imgitem, insert_in=pw.getPlotItem() )
imgitem.setImage(data)

pg.exec()

Expected behavior

The axis lower bound value should not get stuck at -0.2

Real behavior

The axis lower bound value gets stuck at 0.2

Tested environment(s)

  • PyQtGraph version: pyqtgraph 0.12.3
  • Qt Python binding:
  • Python version: 3.8.10
  • NumPy version: 1.21.2
  • Operating system: Windows 10
  • Installation method: pip install -e .

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions