When I push new layer to an existing plot, it keeps the same color. Is there a way to change the color automatically when a new layer is pushed to a plot, or at least a way to set the color using a random number (I don't know in advance how many layers I will have) ?
y=[3, 7, 5, 1]
x=[1, 2, 3, 4]
xmin1 = x .- 0.1
xmax1 = x .+ 0.1
xmin2 = x .- 0.5
xmax2 = x .- 0.3
y=[3, 7, 5, 1]
x=[1, 2, 3, 4]
xmin1 = x .- 0.1
xmax1 = x .+ 0.1
xmin2 = x .- 0.5
xmax2 = x .- 0.3
p = plot(xmin=xmin1, xmax=xmax1, y=[3, 7, 5, 1], Geom.bar)
# The following creates a new layer that keeps the same color
push!(p, layer(xmin=xmin2, xmax=xmax2, y=[3, 7, 5, 1], Geom.bar ))
# I do not want to use this because I don't know how many layers I will have
# push!(p, layer(xmin=xmin2, xmax=xmax2, y=[3, 7, 5, 1], Geom.bar,
# Theme(default_color=colorant"green") ))