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

**URL:** <https://discourse.julialang.org/t/plotting-simple-bar-charts-with-plots-jl-with-colors-conditional-on-sign-of-values/63379>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [June 22, 2021, 3:04pm UTC](https://discourse.julialang.org/t/plotting-simple-bar-charts-with-plots-jl-with-colors-conditional-on-sign-of-values/63379 "2021-06-22T15:04:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 22, 2021, 3:21pm UTC](https://discourse.julialang.org/t/plotting-simple-bar-charts-with-plots-jl-with-colors-conditional-on-sign-of-values/63379/2 "2021-06-22T15:21:38Z")

</div>

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](https://discourse.julialang.org/t/how-to-set-labels-for-eached-coloured-bar-in-plots-jls-bar/9312/6)

You could do:

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

```

![image](https://global.discourse-cdn.com/julialang/original/3X/8/3/83c0b54e525956ed0168dc627b80210722c0d26a.png)

---

_[View the full topic](https://discourse.julialang.org/t/plotting-simple-bar-charts-with-plots-jl-with-colors-conditional-on-sign-of-values/63379)._
