SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

IMAGE PLOT

Name:
    IMAGE PLOT
Type:
    Graphics Command
Purpose:
    Render an image.
Description:
    Much data is now collected as images. You can read image data in one of two ways:

    1. You can convert the data into columns of integer or real numbers and then save these columns into an ASCII file using some external program (e.g., Perl or Python). You can then read this ASCII file in the usual way.

    2. On some platforms, Dataplot can read image data in PNG, GIF, or JPEG format directly. Enter HELP READ IMAGE TO VARIABLES for details). Note that Dataplot will convert the image data to columns of numbers.

    Dataplot does not currently support an "image" data type. Image plots are generated from columns of data. There are two types of images supported:

    1. If there is a single column of data, these values are assumed to represent grey scale values.

    2. If there are three columns of data, these are assumed to represent red-green-blue (RGB) values.

      Although there are other color models, Dataplot currently only supports the RGB model.

    Support for image plots is dependent on the capabilities of the given device. Currently, image plots are supported for the following output devices.

    1. QUICKWIN - the command line version of Dataplot for Microsoft Windows

    2. X11 - current support is limited to grey scale images

    3. GD - the GD device is used to generate PNG, JPEG, or GIF output.

    4. Postscript
Syntax 1:
    IMAGE PLOT <grey> <rowid> <colid>
                            <SUBSET/EXCEPT/FOR qualification>
    where <grey> is a variable that specifies the grey scale values;
                <rowid> is a variable that specifies the row of the image;
                <colid> is a variable that specifies the column of the image;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
    IMAGE PLOT <red> <blue> <green> <rowid> <colid>
                            <SUBSET/EXCEPT/FOR qualification>
    where <red> is a variable that specifies the values of the red component;
                <blue> is a variable that specifies the values of the blue component;
                <green> is a variable that specifies the values of the green component;
                <rowid> is a variable that specifies the row of the image;
                <colid> is a variable that specifies the column of the image;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 3:
    IMAGE PLOT <grey>       <SUBSET/EXCEPT/FOR qualification>
    where <grey> is a matrix that specifies the grey scale values;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 4:
    IMAGE PLOT <red> <blue> <green>
                            <SUBSET/EXCEPT/FOR qualification>
    where <red> is a matrix that specifies the values of the red component;
                <blue> is a matrix that specifies the values of the blue component;
                <green> is a matrix that specifies the values of the green component;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    IMAGE PLOT GREY ROWID COLID
    IMAGE PLOT RED BLUE GREEN ROWID COLID
Note:
    Dataplot will convert the grey scale and RGB values to a (0,1) scale. Image data often, but not always, has the range (0,255).

    Dataplot takes the absolute value of the numbers. By default, Dataplot assumes a (0,255) range. If the maximum absolute value is greater than 255, then the range is assumed to be 0 to that maximum value.

    Alternatively, you can specify the maximum value by entering the command

      SET COLOR MAXIMUM <value>

    The minimum is always assumed to be 0.

    When the image is rendered on a specific device, the (0,1) scale is translated to whatever range is supported on the specific device. For the Quickwin, GD, and Postscript devices, this is (0,255) for each of the red-blue-green-greyscale components. For X11, greyscale is converted to a (0,100) scale and full color is not currently supported.

Note:
    Each row of the image variables is drawn as a single pixel. You can expand the size by entering the command

      CHARACTER SIZE <n>

    where <n> will be rounded to the nearest integer. So if <n> = 2, each row of the image variables will be drawn as a 2x2 square.

    Other than this, Dataplot does not expand or contract the image. If the number of rows or columns in the image exceeds the available number of pixels on the device, the extra rows/columns will simply not be plotted. Likewise, the image will not automatically be explanded to fill a pre-specified size.

    The one exception to this is the Postscript device. More is said about this in the note below.

Note:
    The Quickwin, X11, and GD devices handle images at the pixel level.

    The Postscript device uses image operators that are supported in Postscript. This means that Postscript may perform some scaling/smoothong of the image.

Note:
    Dataplot renders the image in the frame corner coordinates area. To modify the area available for rendering the image, enter the command

      FRAME CORNER COORDINATES <xmin> <ymin> <xmax> <ymax>

    These values are in 0 to 100 units and default to 15, 20, 85, and 90, respectively. To use the full area of the device, enter

      FRAME CORNER COORDINATES 0 0 100 100

    Titles, tic marks, tic mark labels, and axis labels are controlled with the usual commands.

Note:
    Dataplot is primarily a graphical data analysis/statistical analysis program rather than an image manipuilation program. So the primary purpose of reading images is to perform data analysis on the image.

    Once you read an image into Dataplot (into columns of data), you can perform many desired image manipulation functions (e.g., rotation, cropping) using the LET command. Alternatively, you can use freely downloadable image manipulation software such as Image Magick or NetPBM to perform basic image manipulation functions. If this software is installed on your system, you can use the Dataplot SYSTEM command to invoke this software from within Dataplot.

Default:
    None
Synonyms:
    None
Related Commands: Applications:
    Image Analysis
Implementation Date:
    2008/3
Program:
     
    .  Step 1: Define output device
    set postscript ppi 100
    set ipl1na elliott.ps
    device 2 postscript
    .  Step 2: Read image
    dimensions 10 columns
    skip 25
    set read format 3f7.0
    read elliottr.dat y row col
    skip 0
    set read format
    .
    title Elliott Data
    title case asis
    title offset 2
    .  Step 3: Generate the image
    frame corner coordinates 2 2 98 95
    frame off
    character size 1
    image plot y row col
    .
    device 2 close
        
    plot generated by sample program

Date created: 01/06/2009
Last updated: 12/04/2023

Please email comments on this WWW page to alan.heckert@nist.gov.