Alphabetical list Categories
lut Set lookup table for future IMSC.
Call signature:

lut(cc=None, nanc=None)

Help text:

lut(cc) where cc is Nx3 sets a new lookup table for imsc.
lut(cc, nanc) where nanc is a 3-tuple sets a special color to use for NaN values. (The default is white.)

cc must contain rgb values in the range 0 to 1, or, if of type uint8, in the range 0 to 255.

If you have Matplotlib installed, cc may also be a Matplotlib Colormap, e.g., from matplotlib.pyplot.cm.get_cmap(). See also https://matplotlib.org/stable/tutorials/colors/colormaps.html.

lut, nanc = lut() returns current values.

Example:

import qplot as qp

import numpy as np

import matplotlib.pyplot as plt

qp.figure('lut', 3, 3)

xx = np.linspace(0, 2*np.pi, 101)

xx = np.tile(xx, (len(xx), 1))

yy = np.transpose(xx)

zz = np.cos(xx)+np.sin(yy)

qp.subplot(2,2,0)

qp.imsc(zz)

qp.cbar()

qp.shrink(5)

qp.subplot(2,2,1)

qp.lut(qp.luts.get('qphsv'))

qp.imsc(zz)

qp.cbar()

qp.shrink(5)

qp.subplot(2,2,2)

qp.lut(qp.luts.get('qpcoldhot'))

qp.imsc(zz)

qp.cbar()

qp.shrink(5)

qp.subplot(2,2,3)

qp.lut(plt.cm.get_cmap('rainbow', 256))

qp.imsc(zz)

qp.cbar()

qp.shrink(5)

QPlot Documentation — (C) Daniel Wagenaar, 2014–2023