X
2473

How to plot to the same ENVI plot window using ENVI_PLOT_DATA

ENVI users often want to create their own special plot routines using the ENVI plot windows and ENVI_PLOT_DATA. However, there is no documented way to plot multiple times to the same ENVI plot window using ENVI_PLOT_DATA.

This Help Article provides an undocumented routine that allows a user to plot to an ENVI plot window multiple times using ENVI_PLOT_DATA.  Additionally, the routines are intended for ENVI Classic and versions of ENVI prior to ENVI 5.

Note: Undocumented routines are not supported by Exelis VIS Technical Support and not guaranteed to work  in any future version of ENVI.


This example uses an undocumented routine, SP_IMPORT, which ENVI_PLOT_DATA calls internally.
PRO plotGraph, x, y
common plotGraphCommon, base
 
      if not(WIDGET_INFO(base, /valid)) then $
        ENVI_PLOT_DATA, x, y, base=base $
      else $
        sp_import, base, x, y
 
END
 
PRO mainPlot
common plotGraphCommon, base
 
      base = -1L
      FOR i = 0, 5 DO BEGIN
            x = indgen(10)
            y=  indgen(10) * (2*i)
            plotGraph, x, y
      ENDFOR
END

-----------------