Dataplot Vol 1 Vol 2

CIRCLE

Name:
CIRCLE
Type:
Diagrammatic Graphics Command
Purpose:
Draws a circle.
Description:
The 2 pairs of coordinates define the (x,y) values for the two ends of the diameter of the circle.

Coordinates for the circle can be specified in the following ways:

1. Screen units mean that the coordinates are specified in 0 to 100 screen units (Dataplot defines a 0 to 100 coordinate system for the output device in both the horizontal and vertical directions).

Data units mean that the coordinates are specified in units of the most recent plot.

2. Absolute units means that the coordinates for both points are given in absolute units (either screen or data units). Relative units mean that the coordinates of the first point are given in absolute coordinates. The coordinates for the second point are then relative to the first point rather than being absolute coordinates.
Syntax 1:
CIRCLE <x1> <y1> <x2> <y2>
where <x1> is a number or parameter in the decimal range 0 to 100 that specifies the x coordinate for one end of the diameter of the circle;
<y1> is a number or parameter in the decimal range 0 to 100 that specifies the y coordinate for one end of the diameter of the circle;
<x2> is a number or parameter in the decimal range 0 to 100 that specifies the x coordinate for the other end of the diameter of the circle;             and    <y2> is a number or parameter in the decimal range 0 to 100 that specifies the y coordinate for the other end of the diameter of the circle.

This syntax is used for absolute screen units.

Syntax 2:
CIRCLE DATA <x1> <y1> <x2> <y2>
where <x1> is a number or parameter that specifies the x coordinate for one end of the diameter of the circle;
<y1> is a number or parameter that specifies the y coordinate for one end of the diameter of the circle;
<x2> is a number or parameter that specifies the x coordinate for the other end of the diameter of the circle;
and    <y2> is a number or parameter that specifies the y coordinate for the other end of the diameter of the circle.

This syntax is used for absolute data units.

Syntax 3:
CIRCLE RELATIVE <x1> <y1> <x2> <y2>
where <x1> is a number or parameter that specifies the x coordinate for one end of the diameter of the circle;
<y1> is a number or parameter that specifies the y coordinate for one end of the diameter of the circle;
<x2> is a number or parameter that specifies the x coordinate for the other end of the diameter of the circle;
and    <y2> is a number or parameter that specifies the y coordinate for the other end of the diameter of the circle.

This syntax is used for relative screen units.

Syntax 4:
CIRCLE DATA RELATIVE <x1> <y1> <x2> <y2>
where <x1> is a number or parameter that specifies the x coordinate for one end of the diameter of the circle;
<y1> is a number or parameter that specifies the y coordinate for one end of the diameter of the circle;
<x2> is a number or parameter that specifies the x coordinate for the other end of the diameter of the circle;
and    <y2> is a number or parameter that specifies the y coordinate for the other end of the diameter of the circle.

This syntax is used for relative data units.

Examples:
CIRCLE 50 50 60 60
CIRCLE 50 50 60 50
CIRCLE 20 20 30 30
CIRCLE 50 50 10 10
CIRCLE RELATIVE 50 50 10 10
CIRCLE DATA 250 125 345 420
Note:
The line style (i.e., solid, dash), color, and thickness are controlled by the LINE, LINE COLOR, and LINE THICKNESS commands. The REGION FILL command can be used to generate solid filled circles (circles can not currently be filled with hatch patterns).
Note:
If you use a software font, circles can be embedded in text (e.g., the LEGEND or TEXT command) by entering the string CIRC(). To get filled circles, enter LEGEND FILL SOLID (for legends) or FILL ON (for TEXT). Circles can also be used as plot characters (e.g., CHARACTERS CIRCLE), in which case the attributes are set with the various CHARACTER commands.
Note:
By default, Dataplot applies a correction factor to circles based on the ratio of vertical pixels to horizontal pixels. When the number of pixels is not equal in the horizontal and vertical directions, this has the advantage of maintaining the circular appearance of the circle. However, the disadvantage is that the coordinates of the circle may not be as expected. If this correction is not applied, the coordinates of the circle will be as expected. However, the circle may have an elliptic rather than than circular shape.

You can turn off this correction with the command

SET CIRCLE CORRECTION OFF

To turn the correction back on, enter

SET CIRCLE CORRECTION ON
Default:
None
Synonyms:
None
Related Commands:
 POINT = Draws a point. ARROW = Draws an arrow. TRIANGLE = Draws a triangle. BOX = Draws a box. HEXAGON = Draws a hexagon. SEMI-CIRCLE = Draws a semi-circle. ARC = Draws an arc. ELLIPSE = Draws an ellipse. OVAL = Draws an oval. DIAMOND = Draws a diamond. DRAW = Draws a line. MOVE = Moves to a point. LINES = Sets the line type for figures and plot lines. LINE THICKNESSES = Sets the line thickness for figures and plot lines. LINE COLOR = Sets the line colors for figures and plot lines. CROSS-HAIR = Activates and reads the cross-hair. TEXT = Writes a text string.
Applications:
Presentation Graphics
Implementation Date:
Pre-1987
1997/07: Added support for data units
2014/08: Added support for SET CIRCLE CORRECTION command
Program 1:

ERASE
CIRCLE 10 10 20 20
CIRCLE 60 10 80 30
.
THICKNESS 0.7
CIRCLE 10 30 20 40
THICKNESS 0.2
.
LINE DASH
CIRCLE 10 50 20 60
LINE SOLID
.
LINE COLOR G50
CIRCLE 10 80 20 90
LINE COLOR BLACK
.
REGION FILL ON
CIRCLE 30 30 35 35
REGION FILL COLOR G50
CIRCLE 40 40 60 60
.
FILL ON
FONT SIMPLEX
MOVE 40 80
TEXT CIRC() DRAW A CIRCLE WITH THE TEXT COMMAND

Program 2:

.
. Step 1:   Read the data
.
skip 25
read circle.dat x1 y1 x2 y2 x3 y3 x4 y4
skip 0
.
let x1=x1/1000
let y1=y1/1000
let x2=x2/1000
let y2=y2/1000
let x3=x3/1000
let y3=y3/1000
let x4=x4/1000
let y4=y4/1000
.
. Step 2:   Plot points
.
xgrid
ygrid
title Overlapping Plot Circles
x1Label X
y1Label Y

xlimits  322  335
ylimits  6389 6404
.
characters . . * *
character color black black red blue
lines blank blank blank
pre-sort off
.
retain x3 y3 subset x3 > -100 subset y3 > -100
retain x4 y4 subset x4 > -100 subset y4 > -100
.
plot y1 x1 and
plot y2 x2 and
plot y3 x3 and
plot y4 x4
.
. Step 3:   Draw circles on plot, note the elliptical
.           shape of the circles
.
set circle correction off
thickness 0.1
character blank
line solid
.
. Center_1 327.4122 6397.1038
.
line color red
circle data 322.4122 6397.1038 332.4122 6397.1038
.
. Center_2 328.4241 6395.2006

line color blue
circle data 323.4241 6395.2006 333.421 6395.2006


NIST is an agency of the U.S. Commerce Department.

Date created: 01/31/2015
Last updated: 01/31/2015