circles | R Documentation |
Draw circles on a plot, with control over circle size.
circles( x, y, z, data.range = range(z, na.rm = TRUE), circle.size.range = c(0.1, 1), outx = NA, outy = NA, add = FALSE, xlim = NULL, ylim = NULL, ... )
x |
Numeric vector of x coordinates. |
y |
Numeric vector of y coordinates. |
z |
Numeric vector of data used to inform the radii of the drawn circles. In general, this should be the square root of the quantity that you want to represent, because viewers will tend to judge the circles by their area not their radii. |
data.range |
Numeric vector, length 2, minimum and maximum |
circle.size.range |
Numeric vector, length 2, minimum and maximum circle radii in inches, default 0.1 to 1. |
outx |
Numeric scalar of x coordinate beyond the figure margins, default NA (see details). |
outy |
Numeric scalar of y coordinate beyond the figure margins, default NA (see details). |
add |
Logical scalar specifying if circles are added to existing plot (TRUE), default FALSE (a new plot is created). |
xlim |
Numeric vector, length 2, x-axis limits, unused if |
ylim |
Numeric vector, length 2, y-axis limits, unused if |
... |
Additional parameters supplied to the |
The size of the circles plotted corresponds directly with the range of
data.
For example, if there is a z
of size data.range[1]
,
it will be plotted as a circle with radius circle.size.range[1]
,
and if there is a z
of size data.range[2]
,
it will be plotted as a circle with radius circle.size.range[2]
.
The default of NA for outx
and outy
places unseen smallest
and biggest circles at a location where the x and y coordinates are
10 times the range observed plus the maximum observed.
In most instances this should be well beyond the figure margins.
A data frame with the name, class, dimension, and size of each member of the environment.
circles(trees$Height, trees$Girth, sqrt(trees$Volume), data.range=sqrt(c(0, max(trees$Volume))), circle.size.range=c(0, 0.3), xlab="Height (ft)", ylab="Diameter (in)", main="Tree Volume")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.