title: point author: Daniel Jones part: Geometry order: 1008 ...
The point geometry is used to draw various types of scatterplots.
x
: X-axis position.y
: Y-axis position.color
(optional): Point color (categorial or continuous).
using RDatasets
using Gadfly
Gadfly.prepare_display()
Gadfly.set_default_plot_size(14cm, 8cm)
plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth", Geom.point)
# Binding categorial data to the color aesthetic
plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
color="Species", Geom.point)
# Binding continuous data to the color aesthetic
plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
color="PetalLength", Geom.point)
# Binding categorial data to x
plot(dataset("lattice", "singer"), x="VoicePart", y="Height", Geom.point)