Alphabetical list Categories
image Plot an image
Call signature:

image(data, rect=None, xx=None, yy=None, hard=False)

Help text:

image(data) plots an image at (0,0)+(XxY). Note that that differs by 0.5 units from matlab conventions. The image must be YxXx1 or YxXx3 and may be either uint8 or float.
image(data, rect=(x, y, w, h)) specifies location and scale.
If H is negative, the image is plotted upside down.
If W is negative, the image is flipped right to left.
Instead of rect, optional arguments xx and yy may be used to specify bin centers. Only the first and last elements of the vectors are actually used.
Optional argument hard, if true, specifies that pixels should be individually drawn with patch rather than as a pixmap. This ensures sharpness in pdf output for some viewers.

Example:

import qplot as qp

import numpy as np

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

xx = np.repeat(np.reshape(np.arange(10), (1,10,1)), 10, 0)

yy = np.transpose(xx, (1,0,2))

img = np.concatenate((xx/10,yy/10,.5+0*xx), 2)

qp.image(img, [0, 0, 1, 1])

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