<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Image</TITLE> <META NAME="description" CONTENT="Image"> <META NAME="keywords" CONTENT="gnuplot"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="gnuplot.css"> <LINK REL="next" HREF="node72.html"> <LINK REL="previous" HREF="node66.html"> <LINK REL="up" HREF="node55.html"> <LINK REL="next" HREF="node70.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1744" HREF="node70.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html1738" HREF="node55.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html1732" HREF="node68.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html1740" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html1742" HREF="node467.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1745" HREF="node70.html">Transparency</A> <B> Up:</B> <A NAME="tex2html1739" HREF="node55.html">Plotting styles</A> <B> Previous:</B> <A NAME="tex2html1733" HREF="node68.html">Automated iteration over multiple</A> <B> <A NAME="tex2html1741" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html1743" HREF="node467.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION030120000000000000000"></A> <A NAME="commands_set_style_image"></A><A NAME="set_style_image"></A><A NAME="plotting_styles_image"></A><A NAME="style_image"></A><A NAME="image"></A><A NAME="1769"></A> <A NAME="rgbimage"></A><A NAME="1771"></A> <A NAME="rgbalpha"></A><A NAME="1773"></A> <BR> Image </H1> The <B>image</B>, <B>rgbimage</B>, and <B>rgbalpha</B> plotting styles all project a uniformly sampled grid of data values onto a plane in either a 2D or 3D. The input data may be an actual bitmapped image, perhaps converted from a standard format such as PNG, or a simple array of numerical values. <P> <A NAME="1777"></A> 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. <BR> <PRE> 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 </PRE> <BR> <P> 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 <B>binary general keywords flipx (p. <A HREF="node131.html#binary_general_keywords_flipx"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="1781"></A></B>, <B>center (p. <A HREF="node133.html#center"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="1783"></A></B>, and <B>rotate (p. <A HREF="node134.html#rotate"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="1785"></A></B>. <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 <B>binary general keywords dx (p. <A HREF="node130.html#binary_general_keywords_dx"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="1787"></A></B> and <B>dy (p. <A HREF="node130.html#dy"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="1789"></A></B>. 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 <B>dx=0.5 dy=1.5</B>. The short building used a mapping <B>dx=0.5 dy=0.35</B>. <P> The <B>image</B> style handles input pixels containing a grayscale or color palette value. Thus 2D plots (<B>plot</B> command) require 3 columns of data (x,y,value), while 3D plots (<B>splot</B> command) require 4 columns of data (x,y,z,value). <P> The <B>rgbimage</B> 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 <B>plot</B> and 6D data (x,y,z,r,g,b) for <B>splot</B>. The individual red, green, and blue components are assumed to lie in the range [0:255]. <P> The <B>rgbalpha</B> 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 <B>plot</B> and 7D data (x,y,z,r,g,b,a) for <B>splot</B>. The r, g, b, and alpha components are assumed to lie in the range [0:255]. <BR><HR> <!--Table of Child-Links--> <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> <UL> <LI><A NAME="tex2html1746" HREF="node70.html">Transparency</A> <LI><A NAME="tex2html1747" HREF="node71.html">Image failsafe</A> </UL> <!--End of Table of Child-Links--> <HR> <!--Navigation Panel--> <A NAME="tex2html1744" HREF="node70.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html1738" HREF="node55.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html1732" HREF="node68.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html1740" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html1742" HREF="node467.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1745" HREF="node70.html">Transparency</A> <B> Up:</B> <A NAME="tex2html1739" HREF="node55.html">Plotting styles</A> <B> Previous:</B> <A NAME="tex2html1733" HREF="node68.html">Automated iteration over multiple</A> <B> <A NAME="tex2html1741" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html1743" HREF="node467.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2010-08-17 </ADDRESS> </BODY> </HTML>