Gadfly Layer Order (Geom.point and Geom.line)

Thank you for making this fix very quick. Tested the new version. Here are my test results.

  • In Test #1, I’ve not figured out how to change the line color individually.
  • In Test #2, the line color changed as desired, fit exactly my original code.
using Gadfly, RDatasets
iris = dataset("datasets", "iris")

## TEST 1
fs = [x->4.5*(1.0.-exp.(-1.5*(x-4))), x->0.3x+1, x->0.3x+1.1 ]
cs = ["purple", "red", "blue"]#unique(iris.Species)
Gadfly.plot(iris,
    layer(x=:SepalLength, y=:SepalWidth, color=:Species),
    layer(fs, 4.4, 8, color=cs, order=2)
  )

## TEST 2
fs1(x) = 4.5*(1.0.-exp.(-1.5*(x-4)))
fs2(x) = 0.3x+1
fs3(x) = 0.3x+1.1
cs = ["purple", "red", "blue"]#unique(iris.Species)
Gadfly.plot(iris,
    layer(x=:SepalLength, y=:SepalWidth, color=:Species),
    layer(fs1, 4.4, 8, Geom.line, order=2, Gadfly.Theme(default_color=colorant"red")),
    layer(fs2, 4.4, 8, Geom.line, order=2, Gadfly.Theme(default_color=colorant"blue")),
    layer(fs3, 4.4, 8, Geom.line, order=2, Gadfly.Theme(default_color=colorant"green"))
  )

Result from Test #2
Gadfly_layers_order6

Note that Geom.line is the default geometry for layers that begin with function types, so Geom.line isn’t needed in test #2. Also compare:

l1 = layer(fs1, 4.4, 8, order=2) # length(l1)==1
l2 = layer(fs1, 4.4, 8, Geom.line, order=2) # length(l2) == 2 

In l2 there are actually 2 Geom.lines: the default, and the one you added.

Noted. Thanks.