Previous ENVI User's Guide: Interactive Display Functions Next

Using Interactive Plot Functions

Plot windows in general provide several interactive analysis capabilities including moving plots between windows, data input and output, plot output, editing, annotation, and other options.

Mouse Button Functions in Plot Windows

The following table shows the mouse button functions available in ENVI plot windows.

Table 4-8: Mouse Button Functions in ENVI Plot Windows

Table 4-8: Mouse Button Functions in ENVI Plot Windows
Action
Mouse Button
Interaction
Where
Display line-cursor, data point location and X, Y values
Left
Click and hold, drag
Inside plot window over data plot
Resize plot window
Left
Click and drag
Corner of plot window
Move plots to new window
Left
Click and drag to new window
On plot label
Rescale X, Y plot ranges
Middle
Click and drag
From any point inside the plot frame diagonally to form box containing desired subset
Reset to previous X, Y plot ranges
Middle
Click
Inside plot window
Set Y Axis to Data Range
Middle
Click
Left of plot frame
Toggle plot name labels
Right
Click
Inside plot window
Delete specific data plot
Right
Click
On plot label

Displaying an X-Y Cursor

To display an X-Y line-cursor, click and hold the left mouse button within the plot. The line cursor snaps to the closest data point when multiple plots display. The X and Y values of the point will be listed in the lower left corner of the plot in the color corresponding to the selected data set.

To continuously display the line-cursor, data marker, and data values, move the cursor with the left mouse button depressed.

Displaying Plot Data Labels

To toggle data labels on and off, click the right mouse button within the plot to display the right-click menu and select Plot Key.

To edit the plot data label see Editing Y Plot Data Values.

To delete a plot from the plot window, right-click on that data label and select Remove plot name.


Note
You cannot delete the plot for the active cursor; e.g., the X profile, the Y profile or the Z profile in their respective windows.

Moving Plots to Another Plot Window

To move plot labels and their associated data plots from one plot window to another, click and hold the left mouse button on the plot label and drag it into a different plot window and release the mouse button.

Rescaling Plots (Magnify)

To rescale the x and y plot ranges within the plot:

  1. Select the new region to display within the plot window by pressing and holding the middle mouse button at one corner of a box to define the magnification region.
  2.  

    To reset the profile to each of the previous regions, click the middle button within the plot to back-stepping through the previous scalings.

     

  3. Drag the corner to define the box.
  4.  

    Figure 4-23: Magnify Box in Horizontal Profile

    Figure 4-23: Magnify Box in Horizontal Profile

     

  5. Release the mouse button to redraw the enlarged profile subset. To set the Y plot range to encompass the full range of all plotted data, click the middle mouse button to the left of the plot frame.

Plot Window Right-Click Menu

Use the plot window right-click menu to access plot options such as turning the plot key on or off, stacking and unstacking plots, scaling the plot range, and to clearing the plot window.

For detailed descriptions of the menu options, see Plot Window Options.

Importing Plot Data

Use the File menu in a plot window to input into the window. Data input formats include ASCII and ENVI spectral library.

Importing ASCII Spectra Data

Use this procedure to load ASCII data or other (x, y) data to plot in a plot window. ENVI reads ASCII data that has multiple columns separated by commas or white space. Lines beginning with text or semicolons at the top of the file are ignored.

  1. Within the plot window, select File  Input Data  ASCII.
  2.  

  3. When the ASCII Plot Filename dialog appears, select a filename.
  4.  

  5. When the Input ASCII File dialog appears, select from the following options:
    • To select the X values to read into the plot window, enter the number of the column containing the X values into the text box labeled X Axis Column (usually column 1).
    •  

    • To select the Y values to read into the plot window, click on a single column in the Select Y Axis Columns list to select just one column, or press the Ctrl (or Shift) key and click to select multiple columns.
    •  

    • To apply a scale factor to each Y value, enter the desired multiplicative factor into the text boxes labeled Y Scale Factor.

     

  6. Click OK to load the spectrum or other (x, y) plot into the plot window.

When loaded, all of the other plot options are available.

Importing Spectral Library Data

  1. Select File  Input Data  Spectral Library.
  2.  

  3. When the standard ENVI input selection dialog appears, highlight the name of a currently-open spectral library file or a new file.
  4.  

  5. Click OK.
  6.  

  7. When the Input Spectral Library dialog appears, select spectra by clicking on the spectrum names.
  8.  

  9. Click OK to load the spectra into the plot window.

Editing in Plot Windows

Use the Edit pull-down menu to control data and plot parameters and to edit plot data. Data parameters control the line types, colors, and other attributes of plotted data. Plot parameters control the axes, titles, and data ranges plotted.

Editing Data Parameters

  1. In the plot window, select Edit  Data Parameters.
  2.  

  3. When the Data Parameters dialog appears, click on the name of the plot to edit and select from the following options. To change the name of the data label, type the new name in the Name text box and press the Enter or Return key.
    • To change the color of the plotted line, select from the Colors menu.
    •  

    • To select the style of the line (e.g., dotted, dashed, solid), choose from Line Style menu.
    •  

    • To set the thickness of the line, use the Thick parameter box to adjust the value or enter a new value.
    •  

    • To set the number of points to average in the X direction (smoothing) when plotting the data, enter the value in the text box labeled Nsum and press the Return key.
    •  

    • To select the symbol type, select from the Symbol menu.
    •  

    • To control the size of the displayed symbols, use the SymSize text box.
    •  

    • To display the line along with the selected symbols or display only the symbols, use the arrow toggle buttons Symbol & Line or Symbol Only.
    •  

    • Click Apply when all parameters are set to the desired values and Cancel when you wish to close the dialog.

Editing Plot Parameters

  1. Select Edit  Plot Parameters. The Plot Parameters dialog appears.
  2.  


    Note
    Modifications applied with the Plot Parameters dialog only appear in the plot window when the Plot Parameters dialog is open. If you close the Plot Parameters dialog, the plot parameters return to their default values.

     

  3. To set parameters for all axes, select from the following options:
    • To change the plot title, edit it in the Plot Title text box.
    •  

    • To change the foreground and background colors click on the Foreground and Background color swatches. Left-click on the swatch to cycle through the colors available; middle button clicks cycle in the reverse direction; right-clicks bring up the color table list menu from which to choose your colors.
    •  

    • To change the font used for plot labels, select from the Font drop-down button. For more information on fonts, see Using Other TrueType Fonts with ENVI.
    •  

    • To change the character size used for plot labels, click the Charsize arrow increment buttons.
    •  

    • To allow masking of Y values outside the specified ranges (useful for masking bad data points), enter values in the Min Val and Max Val text boxes at the bottom of the dialog.
    •  


      Note
      Data values less than the entered minimum value and greater than the entered maximum value are not plotted.

     

  4. To set parameters for the x or y-axis, click the X-Axis and Y-Axis toggle button.
  5.  

  6. Choose from the following options:
    • To change the title of the axis, enter the title in the Axis Title text box and press the Enter or Return key.
    •  

    • To change the thickness, enter a new value (1 is normal thickness) in the Thick text box.
    •  

    • To position the minimum and maximum values of the full data range exactly at the ends of the axis, select the Style Exact check box.
    •  

    • To offset the values slightly offset from the ends of the axis, select the Style Extend check box.
    •  

    • To turn off the selected axis entirely, select the Style Off check box.
    •  

    • To turn off the top X axis or the right Y axis, depending on which axis is selected, select the Style No Box check box.
    •  

    • To change the axis data range to display, type in the respective minimum and maximum into the text boxes labeled Range and To and press the Return key. (For spectral plots, the plot range for the Y axis can also be set in the .hdr file by entering the values for the Z Plot Range parameter. See ENVI Header Format).
    •  

    • To plot the tick marks on the inside or outside of the axis, click the Tick Style In or Out toggle button.
    •  

    • To plot a continuous line across the entire plot at the location of each major tick mark click the Tick Style Grid toggle button.
    •  

    • To turn off the tick marks entirely, click Tick Style Off.
    •  

    • To change the length of the major tick marks when they are present, enter a value between 0 and 0.5 in the parameter box labeled Tick Length, and the number of minor tick marks in the Minor Ticks textbox. Lengths are measured as a ratio of the axis length normalized to 1.0. For example, a length of 0.02 results in ticks that are 2% of the length of the entire axis. A length of 0.5 results in lines drawn across 50% of the plot that meet in the middle (the equivalent of the grid option).
    •  

    • Select either Auto or Fixed next to the label Tick Marks. The Auto option places a predetermined number of major and minor ticks on the axis. Major tick marks are labeled. The Fixed option allows you to enter the axis parameters. This includes the starting and ending major ticks, the tick increment between the major ticks, and the number of minor ticks between major ticks.
    •  

    • To control the size of the margins around the plot axes, enter the margin size (in characters) in the Left Margin and Right Margin (for the X axis) and the Bottom Margin and Top Margin (for the Y axis) text boxes.

     

  7. Click Apply when all parameters are set to the desired values and Cancel when you wish to close the dialog.

Editing Y Plot Data Values

  1. In the plot window, select Edit  Data Values.
  2.  

  3. When the Select Which Plot to Edit dialog appears, select the name of the plot data to edit.
  4.  

  5. When the Edit Plot dialog appears, containing a list of all x and y values as Xloc (x-value):yvalue, click the y-value to edit. It appears in the Edit Selected Item: text boxes.
  6.  

  7. Change the y-value to the desired value and press the Enter or Return key to change that value in the list.
  8.  

  9. Click OK to update the plot with the new values, or click Reset.

Plot Window Options

Use the Options menu to create new plot windows, annotate plots, stack the data plots, apply automatic scaling to the Y-axis, clearing the plot window, and reset the plot data range.

Creating New Plot Windows

To create a new, blank window, select Options  New Window: Blank.

To create a copy of the current plot window including the data within it, select Options  New Window: with Plots.


Note
New plot windows can be set up as data collectors to hold useful plots from profiles and other plot windows.

To move plots and plot labels between windows, see Moving Plots to Another Plot Window.

For using Annotate Plot to annotate the x, y, and z profiles and other plots, see Annotating Images).


Tip
Resize both plot and Image windows to their final desired size prior to annotation. If the plot window is resized after annotation, the annotated objects will be offset from their correct positions.

Displaying Plot Keys

To turn plot key labels on or off, select Options  Plot Key in the plot window or Plot Key from the right-click menu.

Stacking Plot Data

To offset all plots within the window so there are no overlapping data plots, select Options  Stack Data.

Setting Stack Offset

To set the amount of offset between each stacked plot:

  1. Select Options  Set Stack Offset.
  2.  

  3. Enter the desired value, in percent of data range, in the Plot Stack Offset text box.
Unstacking Plot Data

To replot the data without stacking, select Options  Unstack Data.


Note
Unstack Data appears in the Options menu only if the data has been stacked.

Displaying Profiles of Entire Bands

To show the X or Y profile for the entire band instead of just the part of the band that displays in the Image window, select Options  Profile: Full Band.

To show the X or Y profile only for the part of the band that displays in the Image window, select Options  Profile: Image Window.

Automatically Scaling the Y-Axis

To automatically rescale the Y-Axis to the data minimum and maximum when adding or updating plots, select Options  Auto Scale Y-Axis On.

To leave the current Y-Axis range set, select Options  Auto Scale Y-Axis Off.


Note
If auto scaling is off and a plot is added outside the y-axis range set, that plot will not be visible until the y-axis is rescaled.

Clearing Plots

The Clear Plot selection appears under the Options menu in plot windows if they were created using ENVI spectral library functions or using New Window.

To clear all of the displayed plots within one of these windows, select Options  Clear Plot.


Note
Profiles can not be cleared because they contain the profile for the current pixel.

Resetting Plot Ranges

To reset the x and y plot axes to their default data ranges or minimum and maximum values, select Options  Reset Range or click the middle mouse button to the left of the y-axis.


Note
This option always resets the range to its original values even if it was reset using the Plot Parameters option or using the middle mouse button to zoom into a part of the plot.

Plotting an Average Z Profile Spectrum

The Set Z Profile Avg Window selection appears under the Options menu in Z profile plot windows. Use it to plot an average spectrum calculated using a box around the cursor:

  1. Select Options  Set Z Profile Avg Window.
  2.  

  3. Enter the desired box size, in pixels, in the Window Size text boxes.

The average box size can also be set in the ENVI file header (see Editing ENVI Headers).

Collecting and Replacing Spectra

To plot multiple Z profile spectra, select Options  Collect Spectra.

To replace the current Z profile with the new profile spectrum, select Options  Replace Spectrum.

Additional Functions in Plot Windows

Select from the following additional plot functions. These functions are accessed through the plot window Plot_Function menu.

To plot the band number (or other index number) on the X axis, select Plot_Function  X Axis:Index.

For plots of images with wavelengths in the image header, plot the wavelength on the X axis, select Plot_Function  X Axis:Wavelength.

For plots of images with wavelengths in the image header, plot the wave number (1/wavelength) on the X axis, select Plot_Function  X Axis:1/Wavelength.

To replot the data displayed in the window with its continuum removed, select Plot_Function    Continuum Removed. The continuum is the convex hull that fits over the data and is divided into the original data values to produce the continuum removed values (see Using Continuum Removal for details). The continuum is calculated using the first and last data points displayed in the plot, so for plots that have been zoomed, the continuum is calculated based on the displayed data range only.

To replot the data displayed in the plot window as binary encoded plots (0s and 1s), select Plot_Function    Binary Encoding. Binary encoding replots the data as a spectrum of 0s and 1s. It calculates the mean of the data and encodes each value as a 0 if it is less than or equal to the mean and as a 1 if it is greater than the mean (see Applying Binary Encoding Classification for details).

To replot the original data values, select Plot_Function  Normal.

You can add your own IDL plot function to this menu by entering the name of the function into the useradd.txt file in the ENVI menu subdirectory (see Plot Function) and adding a .pro or .sav file containing the function code to the ENVI save_add subdirectory.

Saving Plot Data

Use the File menu in plot windows to save plot data. You can save plot images or output data to ASCII files, spectral libraries, IDL variables, PostScript files, and image files.

Saving Plot Data to ASCII Files

  1. Select File  Save Plot As  ASCII.
  2.  

  3. When the Output Plots to ASCII File dialog appears, select the data to save by clicking on the plot names in the Select Plots to Output list.
  4.  

  5. Click the arrow increment buttons to set the numeric precision for the X and Y output ASCII variables.
  6.  

  7. Click the arrow toggle button to select whether to save floating point data in Scientific or Normal format.
  8.  

  9. Enter the output name in the text box labeled Enter Output Filename or click the Choose button to select a filename.
  10.  

  11. Click OK to save the selected spectra to the ASCII file.

Saving Plot Data to Spectral Libraries

Use this procedure to build a standard ENVI spectral library file (spectral library image) from profiles and spectral plots.

  1. Select File  Save Plot As  Spectral Library.
  2.  

  3. When the Output Plots to Spectral Library dialog appears, choose the desired spectra by clicking on the spectrum name.
  4.  

  5. Select File or Memory output. If you choose File, enter an output filename.
  6.  

  7. Click OK to save the selected spectra to the Spectral Library.

Exporting Plot Data to the IDL Command Line


Note
If the ENVI command line is not visible in the IDL window, select Window  Command Input in the IDL window.

  1. From the plot window select File  Save Plot As  IDL Variable. The Export Plots to IDL Variable dialog appears.
  2.  

  3. Select the Plots to Export by clicking on the plot names.
  4.  

  5. Select one of the following options:
    • In the New Variable Name dialog, enter the name of an undefined IDL variable.
    •  

    • If previous variables are defined, select the name of a variable to receive the report from the displayed list.

     

  6. Press the Enter key on your keyboard.

The exported data is available to use at the ENVI command line. If data from more than one plot is exported to a single variable, the data is exported into a two-dimensional array that contains the x and y values for each plot. The first row, array [*,0], contains the x values for the first plot, the second row, array [*,1], contains the y values for the first plot, the third row, array [*,2], contains the x values for the second plot, etc.

Saving Plots to Files and Printers

To save a plot and any associated annotation as a PostScript or other image format file, select File  Save Plot As  PostScript or Image File.

To print the plot, select File  Print.

For detailed instructions, see Display Output Options.

  ENVI Online Help (August 12, 2005)