HEXPIE gallery

data(olives)
x <- olives$oleic
y <- olives$linoleic
z <- olives$Region

# the default

hexpie(x, y, z)

plot of chunk unnamed-chunk-2

# zooming in (transformation of the total number of obs in each bin)

hexpie(x, y, z, freq.trans = sqrt)

plot of chunk unnamed-chunk-3

# circular shapes

hexpie(x, y, z, freq.trans = sqrt, shape = "pie")

plot of chunk unnamed-chunk-4

# classical piecharts

hexpie(x, y, z, freq.trans = sqrt, shape = "pie", p.rule = "angles")

plot of chunk unnamed-chunk-5

# the total numbers of obs are reflected via alpha-blending, the grid is not shown and RGB colors are used

hexpie(x, y, z, freq.trans = sqrt, shape = "hex", p.rule = "radial", alpha.freq = TRUE, 
    col = "rgb", show.hex = FALSE)

plot of chunk unnamed-chunk-6

# no transformation, grid shown

hexpie(x, y, z, freq.trans = NULL, shape = "hex", p.rule = "radial", alpha.freq = TRUE, 
    col = "rgb", show.hex = TRUE)

plot of chunk unnamed-chunk-7

# diamonds data

require(ggplot2)
data(diamonds)
x2 <- diamonds$carat
y2 <- diamonds$price
z2 <- diamonds$color

# a standard plot with colors via ggplot2

qplot(x2, y2, colour = z2)