title: hline author: Daniel Jones part: Geometry order: 1005 ...
Draw horizontal lines across the plot canvas.
yintercept
: Y-axis intercept
color
: Color of the lines.size
: Width of the lines.
using RDatasets
using Gadfly
Gadfly.prepare_display()
Gadfly.set_default_plot_size(14cm, 8cm)
plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
yintercept=[2.5, 4.0], Geom.point, Geom.hline)
# Colors and widths of lines can be changed. This works separately from the
# `color` and `size` aesthetics.
plot(dataset("datasets", "iris"), x="SepalLength", y="SepalWidth",
yintercept=[2.5, 4.0], Geom.point,
Geom.hline(color="orange", size=2mm))