In Gadfly, I am trying to color horizontal lines based on data. But since color of Geom.hline
is not an aesthetic, but only an argument, my approach fails. How can I pass color form the data to the color argument?
My attempt:
using DataFrames, Gadfly
test = DataFrame(y = [1,2], group = ["a", "b"])
p = plot(test, yintercept = :y, color=:group, Geom.hline)
Desired behavior:
Two horizontal lines with two different colors (colored by group
).
Actual behavior:
Two horizontal lines with the same color, warning message The following aesthetics are mapped, but not used by any geometry: color
.