Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hexagon

Draw a hexagon


Description

Draws a hexagon on the current graphic device

Usage

hexagon(x,y,unitcell=1,col=NA,border="black")

Arguments

x,y

x and y position of the bottom left corner of the square that would pack into the same space as the hexagon.

unitcell

The dimension of the side of the abovementioned square.

col

The color to fill the hexagon - default is no fill.

border

The color of the perimeter of the hexagon.

Value

nil

Note

Draws a hexagon with the same center as a square that would pack into the same dimensions as the hexagon. That is, given a grid of squares with alternate rows shifted one half the length of the sides, the hexagons drawn would be close packed. Its use in the plotrix package is to provide an alternative unit cell for the color2D.matplot function.

Author(s)

Jim Lemon

See Also


plotrix

Various Plotting Functions

v3.8-1
GPL (>= 2)
Authors
Jim Lemon, Ben Bolker, Sander Oom, Eduardo Klein, Barry Rowlingson, Hadley Wickham, Anupam Tyagi, Olivier Eterradossi, Gabor Grothendieck, Michael Toews, John Kane, Rolf Turner, Carl Witthoft, Julian Stander, Thomas Petzoldt, Remko Duursma, Elisa Biancotto, Ofir Levy, Christophe Dutang, Peter Solymos, Robby Engelmann, Michael Hecker, Felix Steinbeck, Hans Borchers, Henrik Singmann, Ted Toal, Derek Ogle, Darshan Baral, Ulrike Groemping, Bill Venables
Initial release
2021-01-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.