Circle, Disk

The basic use of Circle is demonstrated with the next cell.

crv = Plot[x^3, {x, 0, 3}, DisplayFunction->Identity] ; RowBox[{RowBox[{cir1, =, RowBox[{Gr ... }], ;}] Show[crv, cir1, DisplayFunction->$DisplayFunction, <br />PlotRange {-2, 30}] ;

The next cell demonstrates a circle with radi specified using scaled coordinates.  In this case the radius is 1/4 the width of the graphic in the horizontal direction and 1/4 of the height of the graphic in the vertical direction.  Hence the diameter is 1/2 the size of the graphic in each direction.

RowBox[{RowBox[{cir2, =, RowBox[{Graphics, [, RowBox[{{, RowBox[{Circle, [, RowBox[{RowBox[{{, ... }], ;}] Show[crv, cir2, DisplayFunction->$DisplayFunction,   PlotRange {-2, 30}] ;

The next cell makes a circle with radi given as a combination of scaled coordinates and absolute coordinates.

RowBox[{RowBox[{cir3, =, RowBox[{Graphics, [, RowBox[{{, RowBox[{Circle, [, RowBox[{RowBox[{{, ... }], ;}] Show[crv, cir3, DisplayFunction->$DisplayFunction,   PlotRange {-2, 30}] ;

The documentation for Circle indicates Offset[{ax,ay}] can be used to specify radii in printer points.  This is demonstrated below where the circle is round with a radius of 15 printer points regardless of the AspectRatio or ImageSize.  You can even resize the graphic, and the size of the circle will not change!

Offset [{a_x, a_y}] can also be used to specify radius of a Disk with similar results.

crv = Plot[x^3, {x, 0, 3}, DisplayFunction->Identity] ; RowBox[{RowBox[{RowBox[{cir, =, Row ...  cir, DisplayFunction->$DisplayFunction, <br />AspectRatio->1, ImageSize-> {180, 180}] ;


Created by Mathematica  (May 16, 2004)

Back to Ted’s Tricks index page