# NOT RUN {
# set sequence by `axes.sequence`
p <- ggplot(iris) +
geom_path(alpha = 0.2) +
coord_serialaxes(axes.sequence = colnames(iris))
# an 'iris' parallel coordinate plot.
p
# histogram layer (parallel coord)
p + geom_histogram(alpha = 0.8, mapping = aes(fill = Species))
# density layer
p + geom_density(alpha = 0.8)
# quantile layer
p + geom_quantiles(alpha = 0.8, colour = "red", size = 2)
# radial axes
# set sequence in `mapping`
ggplot(iris,
mapping = aes(
Sepal.Length = Sepal.Length,
Sepal.Width = Sepal.Width,
Petal.Length = Petal.Length,
Petal.Width = Petal.Width,
colour = Species
)) +
geom_path() +
coord_serialaxes(axes.layout = "radial")
# }
Run the code above in your browser using DataLab