Merge pull request #1723 from NilsNemitz/fixed_data_ordering_for_colorbaritem

Set fixed data ordering for ColorBarItem
This commit is contained in:
Ogi Moore 2021-04-17 08:00:56 -07:00 committed by GitHub
commit c62e51f4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,7 @@ class ColorBarItem(PlotItem):
self.axis.unlinkFromView() self.axis.unlinkFromView()
self.axis.setRange( self.values[0], self.values[1] ) self.axis.setRange( self.values[0], self.values[1] )
self.bar = ImageItem() self.bar = ImageItem(axisOrder='col-major')
if self.horizontal: if self.horizontal:
self.bar.setImage( np.linspace(0, 1, 256).reshape( (-1,1) ) ) self.bar.setImage( np.linspace(0, 1, 256).reshape( (-1,1) ) )
if label is not None: self.getAxis('bottom').setLabel(label) if label is not None: self.getAxis('bottom').setLabel(label)