The IPLOT procedure creates an iTool and the associated user interface (UI) configured to display and manipulate plot data.
| Note |
This routine is written in the IDL language. Its source code can be found in the file iplot.pro in the lib/itools subdirectory of the IDL distribution.
IPLOT, [X,] Y
or
IPLOT, X, Y, Z
IPLOT[, R], Theta, /POLAR
iTool Common Keywords: [, BACKGROUND_COLOR=value] [, DIMENSIONS=[x, y]] [, IDENTIFIER=variable] [, LOCATION=[x, y]] [, MACRO_NAMES=string or string array] [, NAME=string] [, /NO_SAVEPROMPT] [, OVERPLOT=iToolID] [, STYLE_NAME=string] [, TITLE=string] [, VIEW_GRID=[columns, rows]] [, /VIEW_NEXT] [, VIEW_NUMBER=integer]
Plot Keywords: [, CLIP_PLANES=array] [, COLOR = RGB vector] [, ERRORBAR_COLOR=vector] [, ERRORBAR_CAPSIZE=float {0.0 to 1.0}] [, /FILL_BACKGROUND] [, FILL_COLOR=vector] [, FILL_LEVEL=value] [, /HIDE] [, /HISTOGRAM] [, LINESTYLE=integer] [, MAX_VALUE=value] [, MIN_VALUE=value] [, NSUM=value] [, /POLAR] [, RGB_TABLE=byte array] [, /SCATTER] [, SYM_COLOR=RGB vector] [, SYM_INCREMENT=integer] [, SYM_INDEX=integer] [, SYM_SIZE=float {0.0 to 1.0}] [, SYM_THICK=float{1.0 to 10.0}] [, THICK=float {1.0 to 10.0}] [, TRANSPARENCY=float {0.0 to 100.0}] [, /USE_DEFAULT_COLOR] [, VERT_COLORS=byte vector] [, /XY_SHADOW] [, /[XYZ]_ERRORBARS] [, /[XYZ]_LOG] [, [XYZ]ERROR=vector or array] [, /XZ_SHADOW] [, /YZ_SHADOW]
Axis Keywords: [, [XYZ]GRIDSTYLE={0 | 1 | 2 | 3 | 4 | 5 | 6}] [, [XYZ]MAJOR=integer] [, [XYZ]MINOR=integer] [, [XYZ]RANGE=[min, max]] [, [XYZ]SUBTICKLEN=ratio] [, [XYZ]TEXT_COLOR=RGB vector] [, [XYZ]TICKFONT_INDEX={0 | 1 | 2 | 3 | 4}] [, [XYZ]TICKFONT_SIZE=integer] [, [XYZ]TICKFONT_STYLE={0 | 1 | 2 | 3}] [, [XYZ]TICKFORMAT=string or string array] [, [XYZ]TICKINTERVAL=value] [, [XYZ]TICKLAYOUT={0 | 1 | 2}] [, [XYZ]TICKLEN=value] [, [XYZ]TICKNAME=string array] [, [XYZ]TICKUNITS=string] [, [XYZ]TICKVALUES=vector] [, [XYZ]TITLE=string]
If the POLAR keyword is set, R is a vector representing the radius of the polar plot. If R is specified, Theta is plotted as a function of R. If R is not specified, Theta is plotted as a function of the vector index of Theta.
If the POLAR keyword is set, Theta is a vector representing the angle (in radians) of the polar plot.
A vector representing the x-coordinates of the plot.
A vector or a two-dimensional array. If Y is:
A vector representing the z-coordinates of the plot.
| Note |
Set this keyword to an RGB value specifying the color to be used as the background color for the view. The default is [255, 255, 255] (white). The BACKGROUND_COLOR keyword can be used when a tool is being created or when a new visualization is being created in an existing tool with the use of the OVERPLOT, VIEW_NUMBER or VIEW_NEXT keywords. The background color is applied to the current view. For example, if multiple views have been created with the VIEW_GRID keyword, and the VIEW_NUMBER keyword is used to create a visualization in the second view, use of the BACKGROUND_COLOR keyword would set the background color in the second view only.
Set this keyword to an array of dimensions [4, N] specifying the coefficients of the clipping planes to be applied to this object. The four coefficients for each clipping plane are of the form [A, B, C, D], where Ax + By + Cz + D = 0. Portions of this object that fall in the half space Ax + By + Cz + D > 0 will be clipped. By default, the value of this keyword is a scalar (-1) indicating that no clipping planes are to be applied.
| Note |
Set this keyword to an RGB value specifying the color to be used as the foreground color for this plot. The default is [0, 0, 0] (black).
Set this keyword to a two-element vector of the form [width, height] to specify the dimensions of the drawing area of the specific tool in device units. The minimum width of the window correlates to the width of the menubar. The minimum window height is 100 pixels.
Set this keyword to an RGB value specifying the color for the error bar. The default value is [0, 0, 0] (black).
Set this keyword to a floating-point value specifying the size of the error bar endcaps. This value ranges from 0 to 1.0, where a value of 1.0 results in an endcap that is 10% of the data range.
This keyword is only available for 2D plots.
Set this keyword to fill the area under the plot. This keyword is only available for two-dimensional plots. This keyword is ignored for three-dimensional plots.
This keyword is only available for 2D plots.
Set this keyword to an RGB value specifying the color for the filled area. The default value is [255, 255, 255] (white). This keyword is only available for two-dimensional plots. This keyword is ignored for three-dimensional plots.
This keyword is only available for 2D plots.
Set this keyword to a floating-point value specifying the y-value for the lower boundary of the fill region. This keyword is only available for two-dimensional plots. This keyword is ignored for three-dimensional plots.
Set this keyword to a boolean value indicating whether this object should be drawn:
This keyword is only available for 2D plots.
Set this keyword to force only horizontal and vertical lines to be used to connect the plotted points. By default, the points are connected using a single straight line. This keyword is only available for two-dimensional plots. This keyword is ignored for three-dimensional plots.
Set this keyword to a named IDL variable that will contain the iToolID for the created tool. This value can then be used to reference this tool during overplotting operations or command-line-based tool management operations.
Set this keyword to indicate the line style that should be used to draw the plot lines. The value can be either an integer value specifying a pre-defined line style, or a two-element vector specifying a stippling pattern.
To use a pre-defined line style, set the LINESTYLE keyword equal to one of the following integer values:
To define your own stippling pattern, specify a two-element vector [repeat, bitmask], where repeat indicates the number of times consecutive runs of 1's or 0's in the bitmask should be repeated. (That is, if three consecutive 0's appear in the bitmask and the value of repeat is 2, then the line that is drawn will have six consecutive bits turned off.) The value of repeat must be in the range 1 £ repeat £ 255.
The bitmask indicates which pixels are drawn and which are not along the length of the line. Bitmask is most conveniently specified as a 16-bit hexadecimal value.
For example, LINESTYLE = [2, 'F0F0'X] describes a dashed line (8 bits on, 8 bits off, 8 bits on, 8 bits off).
Set this keyword to a two-element vector of the form [x, y] to specify the location of the upper left-hand corner of the tool relative to the display screen, in device units.
| Note |
Set this keyword to a scalar string or an array of strings that specifies the names of one or more macros to run. The macro names are retrieved and the macros are run sequentially after the iTool and (if applicable) any visualizations have been created. If a macro of the specified name does not exist, IDL generates an error and the routine exits.
The maximum value to be plotted. If this keyword is present, data values greater than the value of MAX_VALUE are treated as missing data and are not plotted.
| Note |
The minimum value to be plotted. If this keyword is present, data values less than the value of MIN_VALUE are treated as missing data and are not plotted.
| Note |
Set this keyword to a string to specify the name for this visualization.
Set this keyword to cause the iTool not to prompt the user to save changes when closing the tool. The default is to prompt the user to save changes.
Set this keyword to the number of data points to average when plotting. If NSUM is larger than 1, every group of NSUM points is averaged to produce one plotted point. If there are M data points, then M/NSUM points are plotted.
Set this keyword to an iToolID to direct the graphical output of the particular tool to the tool specified by the provided iToolID.
Set this keyword to 1 (one) to place the graphical output for the command in the current tool. If no current tool exists, a new tool is created.
Set this keyword to display the plot as a polar plot. If this keyword is set, the arguments will be interpreted as R and Theta or simply Theta for a single argument. If R is not supplied the plot will use a vector of indices for the R argument.
Set this keyword to either a 3 by 256 or 256 by 3 byte array containing color values to use for vertex colors. If the values supplied are not of type byte, they are scaled to the byte range using BYTSCL. Use the VERT_COLORS keyword to specify indices that select colors from the values specified with RGB_TABLE.
Set this keyword to generate a scatter plot. This action is equivalent to setting LINESTYLE = 6 (no line) and SYM_INDEX = 3 (Period symbol).
Set this keyword equal to a string that specifies the name of a user-defined or a system style. If a style of the specified name does not exist, IDL generates an error and the routine exits. The style is applied using the following rules:
Set this keyword to an RGB value specifying the color for the plot symbol.
| Note |
Set this keyword to an integer value specifying the number of vertices to increment between symbol instances. The default value is 1, which places a symbol on every vertex.
Set this keyword to one of the following scalar-represented internal default symbols:
Set this keyword to a floating-point value from 0.0 to 1.0 specifying the size of the plot symbol. A value of 1.0 results in an symbol that is 10% of the width/height of the plot.
Set this keyword to floating-point value from 1 to 10 points specifying the thickness of the plot symbol.
Set this keyword to a value between 1.0 and 10.0, specifying the line thickness to be used to draw the plotted lines, in points. The default is 1.0 points.
Set this keyword to a string to specify a title for the tool. The title is displayed in the title bar of the tool and is used for tool-related display purposes only-as the root of the hierarchy shown in the Tool Browser, for example.
Set this keyword to floating-point value specifying the transparency of the filled area. Valid values range from 0.0 to 100.0. The default value is 0.0 (opaque).
Set this keyword to have the color of the symbols match the plot color. If this keyword is set to 0 (USE_DEFAULT_COLOR = 0), the color specified by the SYM_COLOR keyword is used for symbols instead of matching the color of the plot.
Set this keyword to a vector of indices into the color table to select colors to use for each vertex (plot data point). Alternately, set this keyword to a 3 by N byte array containing color values to use for each vertex. If the values supplied are not of type byte, they are scaled to the byte range using BYTSCL. If indices are supplied but no colors are provided with the RGB_TABLE keyword, then a default grayscale ramp is used. If a 3 by N array of colors is provided, the colors are used directly and the color values provided with RGB_TABLE are ignored. If the number of indices or colors specified is less than the number of vertices, the colors are repeated cyclically.
Set this keyword to a two-element vector of the form [columns, rows] to specify the view layout within the new tool. This keyword is only used if a new tool is being created (for example, if OVERPLOT, VIEW_NEXT, or VIEW_NUMBER are specified then VIEW_GRID is ignored).
Set this keyword to change the view selection to the next view following the currently-selected view before issuing any graphical commands. If the currently-selected view is the last one in the layout, then /VIEW_NEXT will cause the first view in the layout to become selected. This keyword is ignored if no current tool exists.
| Note |
Set this keyword to change the currently-selected view to the view specified by the VIEW_NUMBER before issuing any graphical commands. The view number starts at 1, and corresponds to the position of the view within the graphics container (not necessarily the position on the screen). This keyword is ignored if no current tool exists.
| Note |
This keyword is only available for 3D plots.
Set this keyword to display a shadow of the plot in a three-dimensional plot. The shadow lies in the XY plane at the minimum value of the data space range of the z-axis. This keyword has no effect for two-dimensional plots.
Set this keyword to show error bars. The Z_ERRORBARS keyword is for three-dimensional plots only.
The index of the linestyle to be used for plot tickmarks and grids (i.e., when [XYZ]TICKLEN is set to 1.0). See LINESTYLE for a list of linestyles.
Set this keyword to specify a logarithmic axis. The minimum value of the axis range must be greater than zero. The Z_LOG keyword is for three-dimensional plots only.
Set this keyword to either a vector or a 2 by N array of error values to be displayed as error bars for the [XYZ] dimension of the plot. The length of this array must be equal in length to the number of vertices of the plot or it will be ignored. If this keyword is set to a vector, the value will be applied as both a negative and positive error and the error bar will be symmetric about the plot vertex. If this keyword is set to a 2 by N array the [0, *] values define the negative error and the [1, *] values define the positive error, allowing asymmetric error bars. The ZERROR keyword is for three-dimensional plots only.
Set this keyword to an integer representing the number of major tick marks. The default is -1, specifying that IDL will compute the number of tickmarks. Setting MAJOR equal to zero suppresses major tickmarks entirely. ZMAJOR is for three-dimensional plots only.
Set this keyword to an integer representing the number of minor tick marks. The default is -1, specifying that IDL will compute the number of tickmarks. Setting MINOR equal to zero suppresses minor tickmarks entirely. ZMINOR is for three-dimensional plots only.
Set this keyword to the desired data range of the axis, a 2-element vector. The first element is the axis minimum, and the second is the maximum. ZRANGE is for three-dimensional plots only.
Set this keyword to a floating-point scale ratio specifying the length of minor tick marks relative to the length of major tick marks. The default is 0.5, specifying that the minor tick mark is one-half the length of the major tick mark. ZSUBTICKLEN is for three-dimensional plots only.
Set this keyword to an RGB value specifying the color for the axis text. The default value is [0, 0, 0] (black). ZTEXT_COLOR is for three-dimensional plots only.
Set this keyword equal to one of the following integers, which represent the type of font to be used for the axis text:
ZTICKFONT_INDEX is for three-dimensional plots only.
Set this keyword to an integer representing the point size of the font used for the axis text. The default is 12.0 points. ZTICKFONT_SIZE is for three-dimensional plots only.
Set this keyword equal to one of the following integers, which represent the style of font to be used for the axis text:
ZTICKFONT_STYLE is for three-dimensional plots only.
Set this keyword to a string, or an array of strings, in which each string represents a format string or the name of a function to be used to format the tick mark labels. If an array is provided, each string corresponds to a level of the axis. The TICKUNITS keyword determines the number of levels for an axis.
If the string begins with an open parenthesis, it is treated as a standard format string. See Format Codes.
If the string does not begin with an open parenthesis, it is interpreted as the name of a callback function to be used to generate tick mark labels. This function is defined with either three or four parameters, depending on whether TICKUNITS is specified.
The callback function is called with four parameters: Axis, Index, Value, and Level, where:
| Note |
Used with the LABEL_DATE function, this property can easily create axes with date/time labels.
ZTICKFORMAT is for three-dimensional plots only.
Set this keyword to a floating-point scalar indicating the interval between major tick marks for the first axis level. The default value is computed according to the axis [XYZ]RANGE and the number of major tick marks ([XYZ]MAJOR). The value of this keyword takes precedence over the value set for the [XYZ]MAJOR keyword.
For example, if TICKUNITS = ['S', 'H', 'D'], and TICKINTERVAL = 30, then the interval between major ticks for the first axis level will be 30 seconds.
ZTICKINTERVAL is for three-dimensional plots only.
Set this keyword to integer scalar that indicates the tick layout style to be used to draw each level of the axis.
Valid values include:
ZTICKLAYOUT is for three-dimensional plots only.
| Note |
Set this keyword to a floating-point value that specifies the length of each major tick mark, measured in data units. The recommended, and default, tick mark length is 0.2. IDL converts, maintains, and returns this data as double-precision floating-point. ZTICKLEN is for three-dimensional plots only.
Set this keyword to a string array of up to 30 elements that controls the annotation of each tick mark. ZTICKNAME is for three-dimensional plots only.
Set this keyword to a string (or a vector of strings) indicating the units to be used for axis tick labeling. If more than one unit is provided, the axis will be drawn in multiple levels, one level per unit.
The order in which the strings appear in the vector determines the order in which the corresponding unit levels will be drawn. The first string corresponds to the first level (the level nearest to the primary axis line).
Valid unit strings include:
If any of the time units are utilized, then the tick values are interpreted as Julian date/time values. Note that the singular form of each of the time value strings is also acceptable (e.g, TICKUNITS = 'Day' is equivalent to TICKUNITS = 'Days').
ZTICKUNITS is for three-dimensional plots only.
| Note |
Set this keyword to a floating-point vector of data values representing the values at each tick mark. If TICKVALUES is set to 0, the default, IDL computes the tick values based on the axis range and the number of major ticks. IDL converts, maintains, and returns this data as double-precision floating-point. ZTICKVALUES is for three-dimensional plots only.
Set this keyword to a string representing the title of the specified axis. ZTITLE is for three-dimensional plots only.
This keyword is only available for 3D plots.
Set this keyword to display a shadow of the plot in a three-dimensional plot. The shadow lies in the XZ plane at the minimum value of the data space range of the y-axis. This keyword has no effect for two-dimensional plots.
This keyword is only available for 3D plots.
Set this keyword to display a shadow of the plot in a three-dimensional plot. The shadow lies in the YZ plane at the minimum value of the data space range of the x-axis. This keyword has no effect for two-dimensional plots.
In the IDL Intelligent Tools system, data can be imported from the IDL Command Line (as described in Example 1), or data can be imported via the File menu in the iTool window (as described in Examples 2 and 3). For detailed information on importing data via the iTool file menu, refer to Data Import Methods.
This example shows how to use the IDL Command Line to load data and variables into the iPlot tool.
At the IDL Command Line, enter:
file = FILEPATH('elnino.dat', SUBDIRECTORY = ['examples','data'])
data = READ_BINARY(file, DATA_TYPE = 4, DATA_DIMS = [500, 1], $
ENDIAN = 'little')
time = DINDGEN(500)*0.25d + 1871
IPLOT, time, data, TITLE = 'El Nino', COLOR = [255, 128, 0]
Place a title on the time axis of your plot by selecting the axis, right-clicking to display the context menu, selecting Properties to display the property sheet, and typing Year in the Title field.
Place a title on the temperature axis of your plot by selecting the axis, displaying the property sheet, and entering the following in the Title field:
Temperature Anomaly(!Uo!NC)
Annotate your plot by selecting the Text Annotation tool, clicking near the top of the plot, and typing El Nino.
Add the special character to the annotation by selecting the annotation text, displaying the property sheet, selecting the lower-case n in Nino in the Title field, and replacing it with the following:
!Z(U+0F1)
| Note |
The following figure displays the output of this example:
This example shows how to use the File ® Open command to load binary data into the iPlot tool.
At the IDL Command Line, enter:
IPLOT
Select File ® Open command to display the Open dialog, then browse to find dirty_sine.dat in the examples/data directory in the IDL distribution, and click Open.
In the Binary Template dialog, click New Field, and enter the following information in the New Field dialog:
Click OK to close the New Field dialog and the Binary Template dialog, and the surface is displayed.
| Note |
Annotate your plot by selecting the Text Annotation tool, clicking near the curve, and typing Noisy Sine Wave.
The following figure displays the output of this example:
This example shows how to use the File ® Import command to load ASCII data into the iPlot tool.
At the IDL Command Line, enter:
IPLOT
Select File ® Import to display the IDL Import Data wizard.
Then, the ASCII Template wizard is displayed.
The plot consists of two overlapping sine waves. To make it easier to distinguish between the two, change the appearance of the noisy sine wave to a dotted line pattern by selecting the noisy sine wave, right-clicking to display the context menu, selecting Properties, and changing the Linestyle property to a dotted line.
The following figure displays the output of this example:
Introduced: 6.0
BACKGROUND_COLOR, MACRO_NAMES, STYLE_NAME keywords added: 6.1