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.

  1. Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (viz_button.gif) in the upper right of the Workbench.)
  2. In IDL, select File →  Open File.
  3. Navigate to the \examples\data directory of the IDL distribution, select the sine_waves.txt file, and click Open.
  4. The ASCII Template dialog opens.

  5. In the ASCII Template dialog:
    • Accept the default settings and click Next.
    • In the ASCII Template Step 2 window, accept the settings and click Next.
    • In the ASCII Template Step 3 window, accept the settings and click Finish.
  6. 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_FIELD1 and SINE_WAVES_TXT_FIELD2 variables now appear:
    sine_variables.gif
  7. From the Variables View, click and drag FIELD1 to the Tool Palette and drop it on the Plot tool.
    icon_plot.gif
  8. The plot displays in a new iPlot window:

sinewaves_field1.gif

  1. Leave the iPlot window open and return to the IDL Workbench. Notice that in the Visualizations view, a plot visualization appears.
    sinewaves_exist_vis.gif
  2. Click on the action toggle button (window_icon.gif) 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.)
  3. Click on the Plot tool to display the Plot actions.
  4. In the first action, you should see the SINE_WAVES_TXT.FIELD1 displayed in the variable field.

  5. From the Variables view, drag SINE_WAVES_TXT.FIELD2 on top of the SINE_WAVES_TXT_FIELD1 in the first action.
  6. Now click on the down arrow next to the IPLOT button in that action, and select IPLOT, /OVERPLOT.
    overplot_button.gif

The two plots now display in the original iPlot window:

sinewaves_overlay.gif

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:

  1. Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (viz_button.gif) in the upper right of the Workbench.)
  2. Enter the following at the command line (or click on the code below to run it in IDL):
  3. RESTORE, FILEPATH('marbells.dat', SUBDIR=['examples','data'])

    The ELEV variable appears in the Variables View.

  4. From the Variables View, drag the ELEV variable to the Image tool.
  5. 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:
    elev_image.gif

  6. Leave the visualization open and return to the IDL Workbench.
  7. Click on the action toggle (window_icon.gif) 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.)
  8. Click on the Contour tool to display the Contour actions.
  9. From the Variables view, drag the ELEV variable onto the variable field in the first Contour action.
  10. 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).
  11. The image visualization now appears with a contour overplot:
    elev_image_contour.gif

Manipulating Plots

Once you have visualized a plot, you can perform many different kinds of operations on it, including: