Tool Palette Actions
Each of the default Visualization tools in the Tool Palette has several associated actions. Each action is a simplified interface to an IDL procedure, which includes positional arguments and keywords.
Actions provide different visualization options for various types of data visualization. Some Visualization tools have many actions, such as Plot. Others have only a few, such as Volume and Vector. The different actions within a visualization type provide different ways to use the corresponding iTools.
In addition to dropping variables on tools, you can drag variables on an action or on individual positional arguments within an action. (See Using Actions.) You can also edit and change the order of system actions and create your own. (See Editing Actions and Creating an Action.) After you create actions, you can share them with your colleagues and use actions that others share with you. (See Exporting Tools and Actions and Importing Tools and Actions.)
Note
Tools do not have to create just visualizations. An action can invoke any IDL procedure. See Creating an Action.
Viewing and Hiding Actions
In the Tool Palette, you have the choice of viewing just the tools or also displaying the corresponding actions. To toggle the view, simply click on the action toggle button (
). (You can also drag the right border of the Tool Palette to the right to display the actions.) For more information on action settings, see Displaying the Tool Actions.
Using Actions
By default, IDL decides which action to use according to the number of data variables that you drop onto a tool. IDL uses the first available action in the list that accepts the number of variables that have been dropped.
Rather than letting IDL decide which action to use, you can drop variables directly on the action of your choice.
Dragging Variables to an Action Example
- Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (
) in the upper right of the Workbench.) - 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 associated Plot actions.

- Enter the following variables at the command line (or click on the code below to run it in IDL):
- Drag the
Xvariable to theXfield of the Line plot:Y vs X action. - Drag the
Yvariable to theYfield of the same action:

- Click on IPLOT in the action. The plot displays in an iPlot window:

x = 2*!PI/100 * FINDGEN(100)
y = sin(x)
The variables now appear in the Variables View.
Note
If you have already moved or deleted actions that you now want to use, you can restore the default system actions. To do this, select Edit Actions from the Tool Palette menu, click Restore Actions, then click Accept Edits. This does not delete any actions you have created, but places them at the end of the list of system actions.
Editing Actions
IDL allows you to move or delete the default system actions and to create and edit new ones.
Moving and Deleting System Actions
The default actions displayed in the Tool Palette can be moved, deleted, and restored. Keep in mind that when you rearrange or add actions, only your local installation of IDL is affected. These local changes do not affect the look of the Tool Palette in any other installation of IDL.
To move, delete, or edit an action, click on the tool you want to edit (Plot, Image, etc.). Click the pull-down Menu button at the top right of the Tool Palette.

Select Edit Actions.
Tip
You can also use the pop-up context menu accessed from the tool to add a new action or edit an existing one.
The action area now appears with the New Action button in the place of the first action and the Cancel Edits and Accept Edits buttons at the top.

- To create a new action using the current action as a template—Click on the plus sign (+) next to the action you want to copy. You can then make any changes you like.
- To move an action—Click on the move button (
) and drag the box to the location you want it to appear. - To delete an action—Click the X button next to the action you want to remove.
- To edit an action—Click on the Edit button in the action you want to change.
Click Accept Edits to save your changes or Cancel Edits to undo any changes and return to the Tool Palette.
Creating an Action
The actions provided by the Tool Palette are just a start. You can create your own actions to meet your needs. The system actions are all created using IDL's iTools.
If you want to create actions that perform some data analysis on your visualizations, then Introducing the IDL iTools is a good place to start. To extend the functionality of basic iTools, see Using the iTools Procedural Interface.
But you can use any IDL procedure, even ones you write yourself. You will need to understand some basic IDL programming and know which procedure you want to use. All the IDL routines are listed in the IDL Reference Guide.
Note
Any action can be used to create an overplot, if the IDL procedure you use to create it supports the OVERPLOT keyword. All of the iTools commands support OVERPLOT, but other IDL commands do not.
The following steps describe how to add a new action.
- To add the new action, 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 tool you want to create (Plot, Image, etc.).
- Click the pull-down menu button at the top right of the Tool Palette.

- Select Edit Actions from the pull-down menu, as shown above.
- Click New Action. The Add New Action dialog appears:

- Add the items for the new action (red text indicates a required field):
- IDL procedure—An existing IDL system procedure or one of your own. Use Content Assist (CTRL+Space) to list all the available procedures.
- Positional Arguments—The name(s) of all the arguments the procedure requires. Each argument must be separated by a comma.
- Keywords—Optional keywords you want to add to refine the procedure. Use Content Assist (CTRL+Space) to list all the available keywords for the procedure.
You can use variable tokens such as`%1'with keywords. (See Using Variable Names (Tokens) with Keywords for more information.) - Title—The short description or name of the action. This name appears as the first line in the action. Each action must have a unique name.
- Description—This description appears when you hover the mouse over the action title.
The action area now appears with Cancel Edits and Accept Edits at the top and New Action below that.

Tip
You can also use the pop-up context menu accessed from the tool to add a new action or edit an existing one.

The example below shows the definition for a new image action:

This action appears in the list of actions bars as:

Notice that the hover help appears when you hover over the title or the keywords:

Using Variable Names (Tokens) with Keywords
Variable tokens are a way to use variable names in keyword definitions. This functionality is helpful for defining titles in and parameter labels in actions. You can see how variable tokens are used in some of the Plot tool action definitions.
Variables Example
The following example shows you how the variables in an action can be used as tokens for window titles and axis labels.
The following line in the action defines the x and y axis titles, the plot title, and the window title using the two variables in the action.

The data for this example is:
plotx=2*!PI/100*FINDGEN(300)
ploty=sin(plotx)
The name of variable x in the variables view is PLOTX and the name of variable y is PLOTY. When these data variables are dropped in the action, the resulting line plot displays.

Troubleshooting Actions
When you create an action, test it right away. If it works differently than you expect, try these options to troubleshoot the functionality:
- Check the spelling and syntax of the IDL Procedure, Arguments and Keywords
- Verify that the data variables you are using are compatible with the tool or action you want to use
- Verify that you have the correct number of arguments
- Remove each keyword, one at a time, and test again
- Try the command on the command line. For the example in Creating an Action, the command would look like:
IIMAGE, file, WINDOW_TITLE='My Title', /FIT_TO_VIEW
Resetting the Default Actions
You can reset the actions in the Tool Palette view back to their original settings. Doing this will restore any system actions you have deleted, but will not delete any actions that you have created. Your custom actions will be placed at the end of the list of actions under each tool.
To reset the actions, select Edit Actions from the Tool Palette menu, click Restore Actions, then click Accept Edits. This does not delete any actions you have created.