Plotting simple bar charts with Plots.jl with colors conditional on sign of values

A color is set per series, as discussed here: How to set labels for eached coloured bar in Plots.jl's bar()? - #6 by xiaodai

You could do:

julia> bar([[i] for i ∈ x], [[i] for i ∈ y], 
            color = permutedims(ifelse.(y .< 0, "#db5a44", "#447adb")), 
            label = "")

image

5 Likes