I’m trying to make a dodged bar plot with error bars in Gadfly. The problem is that the error bars are the same color as the bars, so you can’t see them. I’d like to just make the error bars black.
plot(
base_race_coefs[.!base_race_coefs.occ_controls,:],
x=:race,
y=:coef,
xgroup=:occ_controls,
ymin=:ymin,
ymax=:ymax,
Scale.x_discrete,
color=:shift,
Geom.bar(position=:dodge),
Geom.yerrorbar(),
Stat.dodge
)
results in
I tried using a separate layer and re-setting the color to black, but then the dodging doesn’t work for the error bars:
plot(
base_race_coefs[.!base_race_coefs.occ_controls,:],
x=:race,
y=:coef,
xgroup=:occ_controls,
ymin=:ymin,
ymax=:ymax,
Scale.x_discrete,
color=:shift,
Geom.bar(position=:dodge),
layer(
color=[colorant"black"],
Geom.yerrorbar()
),
Stat.dodge
)
results in
I guess the problem is that color controls both the color and the dodge position, and I’m not sure how to separate them.