This figure illustrates generation of a heat map from an array of scalar values. The current palette is used to map each value onto the color assigned to the corresponding pixel.
plot '-' matrix with image 5 4 3 1 0 2 2 0 0 1 0 0 0 1 0 0 1 2 4 3 e e
Each pixel (data point) of the input 2D image will become a rectangle or
parallelipiped in the plot. The coordinates of each data point will determine
the center of the parallelipiped. That is, an M x N set of data will form an
image with M x N pixels. This is different from the pm3d plotting style, where
an M x N set of data will form a surface of (M-1) x (N-1) elements. The scan
directions for a binary image data grid can be further controlled by additional
keywords. See binary keywords flipx (p. ), keywords center (p.
), and keywords rotate (p.
).
Image data can be scaled to fill a particular rectangle within a 2D plot
coordinate system by specifying the x and y extent of each pixel.
See binary keywords dx (p. ) and dy (p.
). To generate the figure at the right,
the same input image was placed multiple times, each with a specified dx, dy,
and origin. The input PNG image of a building is 50x128 pixels. The tall
building was drawn by mapping this using dx=0.5 dy=1.5. The short building
used a mapping dx=0.5 dy=0.35.
The image style handles input pixels containing a grayscale or color palette value. Thus 2D plots (plot command) require 3 columns of data (x,y,value), while 3D plots (splot command) require 4 columns of data (x,y,z,value).
The rgbimage style handles input pixels that are described by three separate
values for the red, green, and blue components. Thus 5D data (x,y,r,g,b) is
needed for plot and 6D data (x,y,z,r,g,b) for splot. The individual red,
green, and blue components are assumed to lie in the range [0:255].
This matches the convention used in PNG and JPEG files (see binary filetype (p. )).
However some data files use an alternative convention in which RGB components
are floating point values in the range [0:1]. To use the rgbimage style with
such data, first use the command set rgbmax 1.0.
The rgbalpha style handles input pixels that contain alpha channel (transparency) information in addition to the red, green, and blue components. Thus 6D data (x,y,r,g,b,a) is needed for plot and 7D data (x,y,z,r,g,b,a) for splot. The r, g, b, and alpha components are assumed to lie in the range [0:255]. To plot data for which RGBA components are floating point values in the range [0:1], first use the command set rgbmax 1.0.
If only a single data column is provided for the color components of either
rgbimage or rgbalpha plots, it is interpreted as containing 32 bit packed ARGB
data using the convention that alpha=0 means opaque and alpha=255 means fully
transparent. Note that this is backwards from the alpha convention if alpha
is supplied in a separate column, but matches the ARGB packing convention for
individual commands to set color. See colorspec (p. ).