X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



2751 Rate this article:
No rating

Programmatically controlling plots within an ENVI plot window

Note: This help article applies only to Classic ENVI, and not to the new interface introduced with ENVI 5.

Users can programmatically create ENVI plots using ENVI_PLOT_DATA, but the routines to control those plots are not documented. This help article discusses using SP_REMOVE_ALL to remove all plots within an existing plot window and SP_IMPORT to put new plots in an existing plot window.

When you create a plot window via ENVI_PLOT_DATA, one of the keywords to this call is BASE=base. All subsequent control of the plots in the new plot window stems from this base.


After creating an ENVI plot window with ENVI_PLOT_DATA, you can use SP_REMOVE_ALL to remove all plots from that window:

ENVI_PLOT_DATA, x, y, BASE=base
SP_REMOVE_ALL, base



You can also use SP_IMPORT to add a new plot into the plot window:

SP_IMPORT, base, X, Y

Here the X and Y keywords indicate the data which will be plotted into the specified plot window. The Y keyword can be a 2D array (nplots,npoints) to import multiple plot curves at once.

If this is the first plot put into the window, then the automatic scaling of the plot axes will occur. If there are already other plots in the window (or if other plots were in the window at some point), then when this plot is added to the window, the original scaling of axes will be kept intact.

Keywords to SP_IMPORT that will override default properties for the incoming plot include:

NAME, COLOR, LSTYLE, THICK, PSYM, SYMSIZE

If the Y plot variable is an array (specifying multiple plots), then all of these property keywords will also need to be arrays. There are other keywords to SP_IMPORT, but it is expected that they rarely would be needed.

Please note that SP_REMOVE_ALL and SP_IMPORT are not documented routines and are unsupported. Therefore, there is some risk involved in using them. Nevertheless, these routines have been around for a long time, and are unlikely to change in the forseeable future.
Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »