Skip to content

solccp/pgcolorbar

 
 

Repository files navigation

PgColorbar

PgColorbar is a color bar (legend) for PyQtGraph image plots. It can serve as a replacement for PyQtGraph's HistogramLUTItem.

demo screen shot

I started this project because I wansn't satisfied with PyQtGraph's HistogramLUTItem class. This had the following two reasons:

  1. There is to direct way to directly match a color in the bar with the corresponding value. In PgColorBar the tick marks are displayed directly next to the corresponding color.
  2. It is not possible to define your own color scale, only the color scales defined in GradientEditorItem.py can be used.

Look at the demo.py program to see how to integrate PgColorbar in your own program. For a real life example see Argos.

Installing PgColorbar

PgColorbar requires PyQtGraph. Click here to see how to install PyQtGraph.

After installing PyQtGraph you can install PgColorbar with Pip as follows:

%> pip install pgcolorbar

After that you should be able to start the demo with:

%> pgcolorbar_demo

Using PgColorbar

The range of the color scale can be manipulated by panning and zooming the color bar as follows:

  • Pan the range: Drag the legend using the left mouse button up or down to move the color range. This changes the intensity of the colorized image.
  • Zoom the range: Drag the legend using the right mouse button, or scroll with the mousewheel when the cursor is above the legend. This makes the range of the legend larger or smaller and so changes the contrast of the colorized image.
  • Reset the range: Click the middle mouse button (or mouse wheel) while the cursor is above the legend to reset the range of the legend. This uses the image to automatically determine the range.

In the demo program you can also modify the range by setting it in the spin boxes. The demo also allows you to show/hide the histogram.

About

Color bar to use in PyQtGraph plots

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%