Routines (alphabetical) > Routines: E > ELLIPSE

# ELLIPSE

The ELLIPSE function adds an ellipse annotation to an existing IDL graphic.

## Example

The following lines create the graphic shown at the top of this topic.

map = MAP('Lambert Azimuthal', $

LIMIT=[-90,-90,90,90], $

FILL_COLOR="light_blue")

t = TEXT([0.70,0.74], [0.92,0.88], $

["Lambert Azimuthal","Equal-Area Map"])

; Create ellipses within the data space.

for lon=-60,60,30 do for lat=-60,60,30 do $

e = ELLIPSE(lon, lat, MAJOR=10, $

/DATA, FILL_COLOR="yellow")

t = TEXT(0.74, 0.09, "Tissot's Indicatrix")

; Create an ellipse outside of the data.

e = ELLIPSE(0.85, 0.2, MAJOR=0.04, $

FILL_COLOR="yellow")

; Change a property

e.THICK = 2

### Additional Examples

See Annotations examples for additional examples using the ELLIPSE function.

## Syntax

graphic = ELLIPSE(X, Y, [, Z] [, Format] [, Keywords=value] [, Properties=value])

### Keywords

Keywords are applied only during the initial creation of the graphic.

[, /DATA] [, /DEVICE] [, ECCENTRICITY=floating point{0.0 to 1.0}] [, MAJOR=value] [, MINOR=value] [, /NORMAL] [, /RELATIVE ] [, TARGET=variable] [, THETA=value]

### Properties

Properties can be set as keywords to the function during creation, or retrieved or changed using the "." notation after creation.

ANTIALIAS, CLIP, COLOR, FILL_BACKGROUND, FILL_COLOR, FILL_TRANSPARENCY, HIDE, LINESTYLE, NAME, PATTERN_BITMAP, PATTERN_ORIENTATION, PATTERN_SPACING, PATTERN_THICK, POSITION, THICK, TRANSPARENCY, UVALUE, WINDOW

## Methods

Close

ConvertCoord

CopyWindow

Delete

Erase

Order

Print

Refresh

Rotate

Save

Scale

Select

Translate

## Return Value

The ELLIPSE function returns a reference to the created annotation. Use the returned reference to manipulate the annotation after creation by changing properties or by calling methods.

## Arguments

### X, Y, Z

The center location of the ellipse, in data, normal, or device coordinates. For two-dimensional graphics the Z coordinate may be omitted.

### Format

A string that sets line format properties using short tokens to represent the ellipse outline color, linestyle, and thickness values. For example, to create a solid red outline with a thickness value of 2, use the following:

p = ELLIPSE(x, y, '-r2')

Tokens in the Format string represent values of the LINESTYLE, COLOR, and THICK properties. From one to three tokens can be present, and the tokens may be in any order. Tokens are case sensitive. For more information about the syntax of the Format argument, see Formatting IDL Graphics Symbols and Lines.

## Keywords

Keywords are applied only during the initial creation of the graphic.

### DATA

Set this keyword if the input arguments are specified in data coordinates. Setting this property inserts the ellipse into the data space, otherwise the ellipse is added to the annotation layer.

### DEVICE

Set this keyword if values are specified in device coordinates (pixels) for the MARGIN and POSITION properties. (Normalized coordinates are the default for these properties.)

### ECCENTRICITY

Set this keyword to a floating-point value between 0.0 and 1.0 that specifies the eccentricity of the ellipse. The default is 0. This property is ignored if MINOR is present.

### MAJOR

Set this keyword to the length of the semimajor axis for the ellipse, in data, normal, or device coordinates.

### MINOR

Set this keyword to the length of the semiminor axis for the ellipse, in data, normal, or device coordinates. If ECCENTRICITY and MINOR are not specified then a circle is drawn.

### NORMAL

Set this keyword if the input arguments are specified in normalized ( [0, 1] ) coordinates (the default).

### RELATIVE

Set this keyword to indicate that the input arguments are specified in normalized [0,1] coordinates, relative to the axis range of the TARGET's dataspace. If the TARGET keyword is not specified, then setting /RELATIVE is the same as setting /NORMAL.

Note: When using /RELATIVE, even though the coordinates are relative to the TARGET's dataspace, the graphic is added to the annotation layer, not to the dataspace.

### TARGET

Set this keyword to the graphic object to use if points are specified in data coordinates. By default, the current graphic is used.

### THETA

Set this keyword to the angle (in degrees) to rotate the ellipse. If a single value is supplied, the ellipse is rotated counter-clockwise from horizontal. If a three-element vector is supplied, the values define the degrees of rotation around the X, Y, and Z axis, respectively. Rotation is applied in the order of X, Y, and then Z.

## Properties

### ANTIALIAS

By default anti-aliasing is used when drawing lines. Set this property to 0 to disable anti-aliasing.

### CLIP

Set this property to 1 to clip portions of the graphic that lie outside of the dataspace range, or to 0 to disable clipping. The default is 1. This property is ignored unless the DATA property is set.

### COLOR

Set this property to a string or RGB vector that specifies the color of the ellipse outline. The default is "black".

### FILL_BACKGROUND

By default the ellipse is filled with the color white. Set this property to 0 to turn off the fill.

### FILL_COLOR

Set this property to a string or RGB vector that specifies the fill color inside the ellipse. The default is "white".

### FILL_TRANSPARENCY

An integer between 0 and 100 that specifies the percent transparency of the inside of the ellipse. The default value is the same as the TRANSPARENCY property.

### HIDE

Set this property to 1 to hide the graphic. Set HIDE to 0 to show the graphic.

### LINESTYLE

An integer or string specifying the line style for the ellipse outline.

The following table lists the index values and strings you can use with this property.

Index | Property | Description
--- | --- | ---
0 | 'solid_line', '-'(dash) | solid line
1 | 'dot', ':'(colon) | dotted
2 | 'dash', '--' (double dashes) | dashed
3 | 'dash_dot', '-.' | dash dot
4 | 'dash_dot_dot_dot', '-:' | dash dot dot dot
5 | 'long_dash', '__' (two underscores) | long dash
6 | 'none', ' ' (space) | no line

You can also set the line style to a two-element vector, [repeat, bitmask], specifying a stippling pattern. The repeat indicates the number of times that individual bits 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 an integer between 1 and 255. The bitmask indicates which pixels are drawn and which are not along the length of the line. The bitmask should be specified as a 16-bit hexadecimal value. For example, [2, 'AAAA'X] describes a dashed line with very short dashes of length 2 bits each.

### NAME

A string that specifies the name of the graphic. The name can be used to retrieve the graphic using the brackets array notation. If NAME is not set then a default name is chosen based on the graphic type.

### PATTERN_BITMAP

By default the ellipse is filled with a solid color given by FILL_COLOR. Instead, you can specify a fill pattern as a 32x32 bit array (bitmap). The bitmap must be constructed as a 4x32 "bitmap byte array" as created by the CVTTOBM function. Each bit that is a 1 is drawn, each bit that is 0 is not drawn. Each bit in this array represents a 1 point by 1 point square area of pixels on the destination device.

Note: To turn off pattern fill set PATTERN_BITMAP to a scalar 0.

### PATTERN_ORIENTATION

By default the ellipse is filled with a solid color given by FILL_COLOR. By setting any of the PATTERN_ORIENTATION, PATTERN_SPACING, or PATTERN_THICK properties, your ellipse will be filled with a line pattern. Set PATTERN_ORIENTATION to the angle (in degrees counterclockwise from horizontal) of the lines. The default is 0 degrees.

Note: To turn off line fill set PATTERN_SPACING to 0.

### PATTERN_SPACING

By default the ellipse is filled with a solid color given by FILL_COLOR. By setting any of the PATTERN_ORIENTATION, PATTERN_SPACING, or PATTERN_THICK properties, your ellipse will be filled with a line pattern. Set PATTERN_SPACING to the distance (in points) between the lines in the line fill. The default is 0.0 points.

Note: To turn off line fill set PATTERN_SPACING to 0.

### PATTERN_THICK

By default the ellipse is filled with a solid color given by FILL_COLOR. By setting any of the PATTERN_ORIENTATION, PATTERN_SPACING, or PATTERN_THICK properties, your ellipse will be filled with a line pattern. Set PATTERN_THICK to a value between 0.0 and 10.0 that specifies the line thickness (in points) for the line fill. A thickness of 0 displays a thin hairline. The default is 1.0 points.

Note: To turn off line fill set PATTERN_SPACING to 0.

### POSITION

Set this property to a two or four-element vector that determines the position of the graphic within the window. If two elements are provided, the center of the graphic will be translated to that position. For four elements, the coordinates [X1, Y1, X2, Y2] define the lower left and upper right corners of the graphic. Coordinates are expressed in normalized units ranging from 0.0 to 1.0. On creation, if the DEVICE keyword is set, the units are given in device units (pixels).

### THICK

Set this property to a value between 0 and 10 that specifies the thickness of the ellipse outline. A thickness of 0 displays a thin hairline on the chosen device. The default value is 1.

### TRANSPARENCY

An integer between 0 and 100 that specifies the percent transparency of the ellipse. The default value is 0.

### UVALUE

Set this property to an IDL variable of any data type.

### WINDOW (Get Only)

This property retrieves a reference to the window object which contains the graphic.

## Version History

8.0 | Introduced
8.1 | Added the UVALUE property, The THICK property was changed to accept a value between 0 and 10. Added the Delete method.
8.2.2 | Added POSITION property.
8.2.3 | Added the ability to use a stippling pattern for LINESTYLE.
8.5 | Added PATTERN_BITMAP, PATTERN_ORIENTATION, PATTERN_SPACING, and PATTERN_THICK properties.

## See Also

!COLOR, POLYGON, POLYLINE, WINDOW, Using IDL graphics