# UnicodePlots \`barplot\` with different colored bars

**URL:** <https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979>\
**Category:** General Usage\
**Tags:** unicodeplots\
**Created:** [February 7, 2022, 10:53pm UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979 "2022-02-07T22:53:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elmo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elmo/32/17979_2.png) [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Post date:** [February 7, 2022, 10:53pm UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979/1 "2022-02-07T22:53:19Z")

</div>

Is it possible to stack multiple bar plots with different colored bars in one plot? For example, currently I have a function that returns three separate plots, but I think it would look better if I could combine them (e.g. the scale would be better represented and the y-axis would be aligned). Below is an example of what I currently have:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/2/7289bb3d05414ad15b6990b3ff7315ed6afdf497.png)

Is there a way to do this without too much hacking into the source code of UnicodePlots? This would be part of another package, so I am trying to keep dependencies as light as possible, thus I would like to avoid adding Plots.jl if possible… I am aiming for something like this:

 ![image2](https://global.discourse-cdn.com/julialang/original/3X/a/3/a3602669de28ba61cfe21cd41d88a97d4c0983bc.png)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [February 8, 2022, 1:13am UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979/2 "2022-02-08T01:13:57Z")

</div>

> [@Elmo](#):
>
> the scale would be better represented and the y-axis would be aligned

These issues could probably be solved by using the `ylim` argument and left-padding with `lpad()` the string labels.

---

<div class="post-metadata">

**Author:** ![Elmo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elmo/32/17979_2.png) [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Post date:** [February 10, 2022, 7:55pm UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979/3 "2022-02-10T19:55:15Z")

</div>

Thanks! Yep, padding the labels worked great, but it seems bar plots do not make use of the `ylim` argument. See the code below:

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

Any other ideas of how I could force the same scale to be used in both plots?

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [February 11, 2022, 4:58pm UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979/4 "2022-02-11T16:58:14Z")

</div>

It seems this is not implemented yet. Best way forward would probably be to open an issue on [https://github.com/JuliaPlots/UnicodePlots.jl/issues](https://github.com/JuliaPlots/UnicodePlots.jl/issues).

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [February 11, 2022, 5:51pm UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979/5 "2022-02-11T17:51:14Z")

</div>

@Elmo, please comment on the PR fixing this, if that suits you or needs more rework.

[https://github.com/JuliaPlots/UnicodePlots.jl/pull/227](https://github.com/JuliaPlots/UnicodePlots.jl/pull/227)
