MERIS IDL General Purpose Tools

 

Graphics Library

Graphics Library

Last modified: Wed Dec 05 10:45:21 2001.


List of Routines


Routine Descriptions

ASPECT

[Next Routine] [List of Routines]
 NAME:
	    ASPECT

 PURPOSE:
	    This function calculates and returns the normalized position
	    coordinates necessary to put a plot with a specified aspect ratio
	    into the currently active graphics window. It works on the display
	    output window as well as in a PostScript output window.

 CATEGORY:
	Graphics

 CALLING SEQUENCE:

	position = ASPECT(aspectRatio)

 INPUTS:
	aspectRatio: A floating point value that is the desired aspect
	ratio (ratio of heigth to width) of the plot in the current
	graphics output window. If this parameter is missing, an aspect
	ratio of 1.0 (a square plot) is assumed.

 KEYWORD PARAMETERS:
	MARGIN:	The margin around the edges of the plot. The value must be
	a floating point value between 0.0 and 0.5. It is expressed in
	normalized coordinate units. The default margin is 0.15.

 OUTPUTS:
	position: A four-element floating array of normalized coordinates.
	The order of the elements is [x0, y0, x1, y1], similar to the
	!P.POSITION system variable or the POSITION keyword on any IDL
	graphic command.

 EXAMPLE:
	To create a plot with an aspect ratio of 1:2 and a margin of
	0.10 around the edge of the output window, do this:

	   plotPosition = ASPECT(0.5, Margin=0.10)
	   PLOT, Findgen(11), POSITION=plotPosition

	Notice this can be done in a single IDL command, like this:

	   PLOT, Findgen(11), POSITION=ASPECT(0.5, Margin=0.10)

 MODIFICATION HISTORY:
 	Written by:	David Fanning, November 1996.
       Added better error checking, 18 Feb 97, DWF.

(See $IDL_LOCAL\graphics\aspect.pro)


CLIPBOARD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CLIPBOARD

 PURPOSE:
       Copies the contents of a graphics window to the clipboard
       for subsequent pasting into applications such as Photoshop
       or Powerpoint.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

      Graphics.

 CALLING SEQUENCE:

      CLIPBOARD, window_index

 OPTIONAL INPUTS:

       window_index:    The window index number of the graphics window to
                        copy. If absent, the current graphics window is used
                        by default.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 DEPENDENCIES:

       Uses the IDLgrClipboard object introduced in IDL 5.2(?).

 PROCEDURE:

       Copies the window contents to a clipboard object.

 EXAMPLE:

        IDL> Window
        IDL> Plot, Findgen(11)
        IDL> CLIPBOARD

 RESTRICTIONS:

       May not work for all applications. Applications tested successfully
       include: Framemaker, Powerpoint, Photoshop, Excel, Microsoft Word.
       Converts 24-bit images to 2D images with color tables.

 MODIFICATION HISTORY:

       Written by: David W. Fanning, 24 October 2001.

(See $IDL_LOCAL\graphics\clipboard.pro)


PRINTWINDOW

[Previous Routine] [Next Routine] [List of Routines]
 NAME
   PRINTWINDOW

    This program sends the contents of the specified
    window to the default printer. The current window
    is used if a window index number is not provided.

 AUTHOR:

   FANNING SOFTWARE CONSULTING
   David Fanning, Ph.D.
   1645 Sheely Drive
   Fort Collins, CO 80526 USA
   Phone: 970-221-0438
   E-mail: davidf@dfanning.com
   Coyote's Guide to IDL Programming: http://www.dfanning.com/

 CATEGORY:

  Graphics

 CALLING SEQUENCE:

  IDL> PrintWindow, wid

 OPTIONAL POSITIONAL PARAMETERS:

   WID       The window index number of the window to send to the
             printer. !D.Window used by default.

 KEYWORD PARAMETERS:

   LANDSCAPE  If this keyword is set, the output is in Landscape
              mode. Otherwise, Portrait mode is used.

   PAGESIZE: Set this keyword to a string indicating the type
             of PostScript page size you want. Current values are "LETTER",
             "LEGAL", and "A4". Default is "LETTER".

 MODIFICATION HISTORY:

 Written by David Fanning based on previous PRINT_IT program. 29 July 2000.

(See $IDL_LOCAL\graphics\printwindow.pro)


TVREAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       TVREAD

 PURPOSE:
       To get accurate screen dumps with the IDL command TVRD on 24-bit
       PC and Macintosh computers, you have to be sure to set color
       decomposition on. This program adds that capability automatically.
       In addition, the program will optionally write BMP, GIF, JPEG,
       PICT, PNG, and TIFF color image files of the screen dump.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       1645 Sheely Drive
       Fort Collins, CO 80526 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Graphics

 CALLING SEQUENCE:

       image = TVREAD(xstart, ystart, ncols, nrows)

       The returned image will be a 2D image on 8-bit systems and
       a 24-bit pixel interleaved true-color image on 24-bit systems.
       A -1 will be returned if a file output keyword is used (e.g., JPEG, TIFF, etc.).

 OPTIONAL INPUTS:

       XSTART -- The starting column index.  By default, 0.

       YSTART -- The starting row index. By default, 0.

       NCOLS -- The number of columns to read. By default, !D.X_Size - XSTART

       NROWS -- The number of rows to read. By default, !D.Y_Size - YSTART.

 KEYWORD PARAMETERS:

       BMP -- Set this keyword to write the screen dump as a color BMP file.

       COLORS -- If a 24-bit image has to be quantized, this will set the number
          of colors in the output image. Set to 256 by default. Applies to BMP,
          GIF, PICT, and PNG formats written from 24-bit displays.(See the
          COLOR_QUAN documentation for details.)

       CUBE -- If this keyword is set to a value between 2 and 6 the color
          quantization will use a cubic method of quantization. Applies to BMP,
          GIF, PICT, and PNG formats written from 24-bit displays.(See the
          COLOR_QUAN documentation for details.)

       DITHER -- If this keyword is set the quantized image will be dithered.
          Applies to BMP, GIF, PICT, and PNG formats written from 24-bit displays.
          (See the COLOR_QUAN documentation for details.)

       FILENAME -- The base name of the output file. (No file extensions;
           they will be added automatically.) This name may be changed by the user.

              image = TVREAD(Filename='myfile', /JPEG)

           No file will be written unless a file output keyword is used
           (e.g., JPEG, TIFF, etc.) in the call. By default the FILENAME is
           set to "idl". The file extension will be set automatically to match
           the type of file created.

       GIF -- Set this keyword to write the screen dump as a color GIF file.

       JPEG -- Set this keyword to write the screen dump as a color JPEG file.

       NODIALOG -- Set this keyword if you wish to avoid the DIALOG_PICKFILE
           dialog that asks you to name the output file. This keyword should be
           set, for example, if you are processing screens in batch mode.

       PICT -- Set this keyword to write the screen dump as a color PICT file.

       PNG -- Set this keyword to write the screen dump as a color PNG file.

       TIFF -- Set this keyword to write the screen dump as a color TIFF file.

       QUALITY -- This keyword sets the amount of compression for JPEG images.
           It should be set to a value between 0 and 100. It is set to 75 by default.
           (See the WRITE_JPEG documentation for details.)

       WID -- The index number of the window to read from. The current graphics window
           (!D.Window) is selected by default. An error is issued if no windows are
           currently open on a device that supports windows.

       _EXTRA -- Any keywords that are appropriate for the WRITE_*** routines are
           also accepted via keyword inheritance.

 COMMON BLOCKS:

       None

 RESTRICTIONS:   Requires ERROR_MESSAGE from the Coyote Library:

                     http://www.dfanning.com/programs/error_message.pro

                 Requires IDL 5.2 and higher.

 MODIFICATION HISTORY:

       Written by David Fanning, 9 AUG 2000.
       Added changes to make the program more device independent. 16 SEP 2000. DWF.
       Removed GIF file support for IDL 5.4 and above. 18 JAN 2001. DWF.
       Added NODIALOG keyword. 28 MAR 2001. DWF.

(See $IDL_LOCAL\graphics\tvread.pro)


WOPLOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WOPLOT

 PURPOSE:
       Overplots X,Y data in a resizeable, zoomable WPLOT window. If a call
       to WPLOT has not yet occurred, WOPLOT calls WPLOT.

 CATEGORY:
       Direct Graphics

 CALLING SEQUENCE:
       WOPLOT, X, Y

 INPUTS:
       X: abscissa data
       Y: ordinate data

 KEYWORD PARAMETERS:
       All the keywords allowed in the OPLOT command

 OUTPUTS:
       None

 COMMON BLOCKS:
       WPLOT_COMM: This common block contains the state and data pointers.

 SIDE EFFECTS:
       This routine will no longer work if the command
         PTR_FREE, PTR_VALID()
       is used, either on the command line or in any application programs.

 RESTRICTIONS:
       Cannot use the command
         PTR_FREE, PTR_VALID()
       anywhere when WPLOT windows are active.

 PROCEDURE:
       The data displayed in the WPLOT window, and the associated PLOT keywords used, are
       stored in a linked list for each WPLOT window. Each linked list is accessed
       through a data pointer array. The state information for each window is stored
       in a structure array. Both of these arrays are accessed via pointers in a
       common block.

 EXAMPLE:
       x = findgen(100)
       y = x
       wplot, x, y
       woplot, x, 0.01*y^2, color = 20
       woplot, x, 10.0*sqrt(y), color = 80

 MODIFICATION HISTORY:
 	Written by:     Paul van Delst, CIMSS/SSEC, 26-Nov-1997

 $Author: chr $
 $Date: 2001/06/28 09:10:26 $
 $Id: woplot.pro,v 1.2 2001/06/28 09:10:26 chr Exp $
 $Log: woplot.pro,v $
 Revision 1.2  2001/06/28 09:10:26  chr


 PURPOSE of modifications: added keyword substitution for the pro files

 IMPACT:

 SPR nber:

 Reference:

 Comment:

 Revision 1.1  2001/04/26 17:46:00  vfs
 transfered from utilities

 Revision 1.1.1.1  2001/03/27 12:49:55  chr
 Import of idl sources

 Revision 1.4  1997/11/28 17:27:52  paulv
 Renamed X,Y parameters to allow overplotting of only Y data.

 Revision 1.3  1997/11/26 17:03:03  paulv
 Added X,Y parameter checks.

 Revision 1.2  1997/11/26 16:45:38  paulv
 Removed WPLOT_CREATE_GUI call. The condition that would lead
 to this call should *never* occur. However, we shall see.....
 Call replaced with an error message and a STOP command.

 Revision 1.1  1997/11/26 16:09:42  paulv
 Initial revision


(See $IDL_LOCAL\graphics\woplot.pro)


WPLOT

[Previous Routine] [Next Routine] [List of Routines]

 (C) Cooperative Institute for Meteorological Satellite Studies, 1997

 NAME:
       wplot

 PURPOSE:
       Plots X,Y data in a resizeable, zoomable graphics window. To zoom in
         press the LEFT mouse button and drag the rubber-band box over the region
         of interest. To return to the original plotting limits, press the RIGHT
         mouse button.
       An output menu bar allows the user to output the current plot as a PostScript
         file named wplot.ps.

 CATEGORY:
       Graphics

 CALLING SEQUENCE:
       wplot, x, y, new = new

 INPUTS:
       x: abscissa data
       x: ordinate data

 KEYWORD PARAMETERS:
       All the keywords allowed in the PLOT command

       new: Set this keyword to create a new WPLOT window rather than reusing
            an existing one.

 OUTPUTS:
       None (yet)

 COMMON BLOCKS:
       WPLOT_COMM: This common block contains the state and data pointers.

 SIDE EFFECTS:
       - This routine will no longer work if the command
           PTR_FREE, PTR_VALID()
         is used, either on the command line or in any application programs.
       - The graphics device is changed, if required, to allow WPLOT windows
         to be opened.
       - The !P.MULTI system variable is set to 0.
       - If the XSTYLE and YSTYLE keywords are not used on logarithmic plots,
         zooming in will only occur for decadal intervals.

 RESTRICTIONS:
       - Cannot use the command
           PTR_FREE, PTR_VALID()
         anywhere when WPLOT windows are active...at least if you want the WPLOT
         windows to keep working.
       - Cannot have more than one plot to a window, i.e. !P.MULTI must = 0

 PROCEDURE:
       The data displayed in the WPLOT window, and the associated PLOT keywords used, are
       stored in a linked list for each WPLOT window. Each linked list is accessed
       through a data pointer array. The state information for each window is stored
       in a structure array. Both of these arrays are accessed via pointers in a
       common block.

 EXAMPLE:
       x = findgen(100)
       y = x
       wplot, x, sqrt(y)

 MODIFICATION HISTORY:
 	Written by:     Paul van Delst, CIMSS/SSEC, 25-Nov-1997
                       paul.vandelst@ssec.wisc.edu

 $Revision: 1.2 $


(See $IDL_LOCAL\graphics\wplot.pro)


XPLOT

[Previous Routine] [List of Routines]
 NAME:
       XPLOT

 PURPOSE:
       The purpose of this program is to demonstrate how to
       create a line plot with axes and a title in the
       new IDL 5 object graphics.

 AUTHOR:
       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:
       Widgets, IDL 5 Object Graphics.

 CALLING SEQUENCE:
       XPlot, x, y

 REQUIRED INPUTS:
       x: A vector of input values used as the dependent data.

 OPTIONAL INPUTS
       y: A vector of input values used as the dependent data.
          If both x and y parameters are present, x is the independent data.

 OPTIONAL KEYWORD PARAMETERS:

       _EXTRA: This keyword collects otherwise undefined keywords that are
       passed to new Plot command. To some extent these are similar to the
       old IDL Plot command. For example: Linestyle=2, Thick=3,
       XRange=[-100,100], etc.

       GROUP_LEADER: The group leader for this program. When the group leader
       is destroyed, this program will be destroyed.

       PSYM: The index of a plotting symbol to use on the plot. Integers 0-7
       are valid values.

       TITLE: A string used as the title of the plot.

       XTITLE: A string used as the X title of the plot.

       YTITLE: A string used as the Y title of the plot.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       None.

 RESTRICTIONS:
       Axes are always drawn with the Exact keyword set.

 EXAMPLE:
       To use this program, pass a 1D vector or vectors, like this:

        IDL> XPlot, RandomU(seed, 11) * 9, YRange=[0, 10]

 MODIFICATION HISTORY:
       Written by David Fanning, 13 June 97.
       Modified axis font handling. 17 Sept 97. DWF.

(See $IDL_LOCAL\graphics\xplot.pro)


HOME|Index|Work in Progress