by Ben-chin Cha (06/18/99)


PLOT2D provides the IDL user with a general purpose 2D plot package for various displays of a two-dimensional array. It provides various TV, SURFACE, CONTOUR, and SHADE_SURF 2D plot features. It allows the user dynamically reset the plot title, margins, surface plot viewing angles, X, Y labels, color scheme and generate the PostScript plot.

The widget window associated with PLOT2D is readjustable by the window manager.

Command Syntax

Please refer User's Reference Guide for PLOT2D for command syntax.


Setup Requirement for Unix System

At APS all IDL programs are installed in the /usr/local/epics/extensions/bin/$HOST_ARCH directory. For proper operation of these programs, a user first has to make sure that the IDL 5.0 or later is used. For example, use IDL 5.2 release, set the following :
	source /usr/local/rsi/idl_5.2/bin/idl_setup 
In order to access IDL programs installed in the local epics/extensions/bin, a user has to make sure that the following two environment variables are set before invoking IDL :
         setenv EPICS_EXTENSIONS /usr/local/epics/extensions
and make sure the directory /usr/local/epics/extensions/bin/$HOST_ARCH is in his/her IDL search path.

Access PLOT2D Program

To access the PLOT2D program in IDL just enter the following command at the IDL prompt:
	IDL>plot2d, Data [,Xarr=x, Yarr=y]
This commnad will automatically load the, and program into the IDL session and initially display the Data as a TV image. (The variable Data should contains the 2-dimensional data array.) A user than can use the various features of plot2d program to display the data array. If the X, Y coordinates to be used in the TV plot, the keywords Xarr, and Yarr must be specified. If Xarr and Yarr is not specified, the index number is used in plot.


Two rows of buttons are available for viewing the data and obtaining the final PS plot. The top row of buttons allows the user selects the type of plot desired. The bottom row of buttons allows the user ajusts the plot title, labels, margins, etc. according to the user preference. The buttons labeled with the suffix ... indicates there is a window or widgets associated with it.



Display 2D data as TV image.


Display 2D data as a surface mesh plot.


Display 2D data as a coloured contour plot.


Display 2D data as a w/o light shaded color surface plot.


Update plot2d.txt file with 2D ASCII data, display by xdisplayfile, and pops up rename_dialog


Display the html documents URL about plot2d.



Save the 2D plot in the POSTSCRIPT file '' and send the PS plot to the default or selected printer.


Override the default printer name.


Run the XLOADCT program and then select/load the desired color table.

Plot Options...

Popup the plot2d_options dialog. Different buttons or fields apply to different type of plot options. They are given below:
  • Xlog - apply to SURFACE, SHADE_SURF plot
  • Ylog - apply to SURFACE, SHADE_SURF plot
  • Zlog - apply to SURFACE, SHADE_SURF plot
  • Lego - apply to SURFACE plot
  • Shade - apply color shade to SURFACE, SHADE_SURF plot
  • ColorBar - apply to TV plot
  • Stamp - apply to all types of plot
  • Charsize - apply to SURFACE, SHADE_SURF plot
  • Contour_Lebels... - apply to CONTOUR plot (at most 12 allowed)
  • Rotation Angle Ax slider - apply to SURFACE, SHADE_SURF plot
  • Rotation Angle Az slider - apply to SURFACE, SHADE_SURF plot
  • SetPlotMargins - apply to all type of plots, ajust plot margins: top,bottom,left,right margin fields shrink or expand margins
  • SetPlotLabels - apply to all type of plots, ajust plot labels: title, xtitle, ytitle fields legends and relative location fields
  • Save TIFF... - save as TIFF in plot2d.tiff with rename option
  • Save GIF... - save as GIF in plot2d.gif with rename option
  • Close - close the Plot Options dialog
  • TV Options...

    In order to improve the color contrast of an image, the data is linearly scaled with the color table. The color bar shows the color scheme used by the TV image. Combining the Color... with the TV Options... a user should be able to ajust the image to meet his/her desire. TV option dialog provides the following features:
  • Default - display the default scaled image
  • Hist_Equal - display a histogram-equalized version of image
  • Done - close the TV Options dialog
  • Scaling Pixels < Slider - specify the pixel value upper bound
  • Scaling Pixels > Slider - specify the pixel value lower bound
  • Smooth Width - specify 7x7 neighborhood for smoothing
  • Smooth - disply smoothed image
  • Unsharp Mask - display the unsharp mask
  • Roberts - display the Roberts gradient of sharpened image
  • Sobel - display the Sobel edge-enhanced image
  • Threshold< - display less than threshold setting as white
  • Threshold> - display greater than threshold setting as white
  • Threshold Slider - set the threshold value
  • Done

    Close the PLOT2D program.