From 0d2bd107b31649c14ce364e74bf961fc65735f67 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sat, 2 Apr 2016 23:27:20 -0700 Subject: [PATCH] Use colormap with better perceptual contrast --- examples/ImageView.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/ImageView.py b/examples/ImageView.py index 94d92a70..881d8cdd 100644 --- a/examples/ImageView.py +++ b/examples/ImageView.py @@ -49,10 +49,16 @@ data[:,50:60,50:60] += sig imv.setImage(data, xvals=np.linspace(1., 3., data.shape[0])) ## Set a custom color map -positions = [0, 0.5, 1] -colors = [(0,0,255), (0,255,255), (255,255,0)] -cm = pg.ColorMap(positions, colors) -imv.setColorMap(cm) +colors = [ + (0, 0, 0), + (45, 5, 61), + (84, 42, 55), + (150, 87, 60), + (208, 171, 141), + (255, 255, 255) +] +cmap = pg.ColorMap(pos=np.linspace(0.0, 1.0, 6), color=colors) +imv.setColorMap(cmap) ## Start Qt event loop unless running in interactive mode. if __name__ == '__main__':