Plot Visualizations
Using the Visualize Perspective, basic plots are easy to create and view.
Plot With Overplot Example
The following example uses the sine_waves.txt example data file to open two plots and then overlay (overplot) one on the other.
Note
This example assumes the default action definitions. Your results may be different if you have added new actions or changed the order of actions. To return all Tool Palette actions to their system default state, see Resetting the Default Actions.
- Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (
) in the upper right of the Workbench.) - In IDL, select File → Open File.
- Navigate to the
\examples\datadirectory of the IDL distribution, select thesine_waves.txtfile, and click Open. - In the ASCII Template dialog:
- In the Variables view, click on the plus sign (+) next to SINE_WAVES_TXT to display the variables within the structure. The
SINE_WAVES_TXT_FIELD1andSINE_WAVES_TXT_FIELD2variables now appear:

- From the Variables View, click and drag
FIELD1to the Tool Palette and drop it on the Plot tool.

The ASCII Template dialog opens.
The plot displays in a new iPlot window:

- Leave the iPlot window open and return to the IDL Workbench. Notice that in the Visualizations view, a plot visualization appears.

- Click on the action toggle button (
) to expand the Tool Palette to display the actions. (You can also drag the right border of the Tool Palette to the right to display the actions.) - Click on the Plot tool to display the Plot actions.
- From the Variables view, drag SINE_WAVES_TXT.FIELD2 on top of the SINE_WAVES_TXT_FIELD1 in the first action.
- Now click on the down arrow next to the IPLOT button in that action, and select IPLOT, /OVERPLOT.

In the first action, you should see the SINE_WAVES_TXT.FIELD1 displayed in the variable field.
The two plots now display in the original iPlot window:

Alternative Methods for Overplotting (Windows Only)
On Windows platforms the IDL drag and drop functionality allows alternatives to using the overplot button in actions. When you have an existing visualization, you can overplot by dragging a variable from the Variables view on to the following:
For more control, you can also drag a variable to an action, then drag the action on to an existing visualization (shown in the iTool or in the Visualizations view.) This is useful for creating a visualization based on a specific action, and for data that could be used for more than one kind of visualization. The following example uses elevation data from the Maroon Bells data set. This data can be visualized as image data and as contour data, so we will combine them by overplotting:
- Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (
) in the upper right of the Workbench.) - Enter the following at the command line (or click on the code below to run it in IDL):
- From the Variables View, drag the
ELEVvariable to the Image tool. - Leave the visualization open and return to the IDL Workbench.
- Click on the action toggle (
) to expand the Tool Palette to display the actions. (You can also drag the right border of the Tool Palette to the right to display the actions.) - Click on the Contour tool to display the Contour actions.
- From the Variables view, drag the
ELEVvariable onto the variable field in the first Contour action. - Now click in the action (not on the ICONTOUR button) and drag it onto the visualization in the iTools window (or in the Visualizations view).
RESTORE, FILEPATH('marbells.dat', SUBDIR=['examples','data'])
The ELEV variable appears in the Variables View.
Note
This example assumes the default contour action definitions. Your results may be different if you have added new actions or changed the order of actions. To return all Tool Palette actions to their system default state, see Resetting the Default Actions.
A visualization of the elevation data displays as an image:

The image visualization now appears with a contour overplot:

Manipulating Plots
Once you have visualized a plot, you can perform many different kinds of operations on it, including:
- Overplotting another visualization (see Surface and Contour Example and Plot With Overplot Example, and Alternative Methods for Overplotting (Windows Only))
- Modifying properties such as adding legends, colorbars, error bars, curve fitting, and filtering (see Plot Properties)
- Manipulating the plot by adding annotations, zooming, rotating, or translating (moving) the plot (see Working with Plots.)
- Changing iPlot operations such as scaling, or viewing statistics or a histogram (see iPlot Tool Operations)
- Using the iTools Procedural Interface to add a variety of annotations.