# Create a multicolor (gradient, palette) bar in Plots

**URL:** <https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546>\
**Category:** General Usage\
**Tags:** question, plotting, plots\
**Created:** [July 27, 2024, 2:40pm UTC](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546 "2024-07-27T14:40:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eotero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eotero/32/36642_2.png) [@eotero](https://discourse.julialang.org/u/eotero)\
**Post date:** [July 27, 2024, 2:40pm UTC](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546/1 "2024-07-27T14:40:23Z")

</div>

In Julia is easy to assign a color to each bar with Julia Plots, but how can I combine colors for each bar, suppose I want to apply a kind of palette to fill the bar.

Thanks.

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [July 28, 2024, 3:20am UTC](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546/2 "2024-07-28T03:20:43Z")

</div>

Can you show us an example of the picture of the plot you are interested in?  
If you cannot reproduce the example by code, can you at least hand draw it?

---

<div class="post-metadata">

**Author:** ![eotero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eotero/32/36642_2.png) [@eotero](https://discourse.julialang.org/u/eotero)\
**Post date:** [August 1, 2024, 2:12am UTC](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546/3 "2024-08-01T02:12:59Z")

</div>

Sure.

![multiclorBard](https://global.discourse-cdn.com/julialang/original/3X/2/4/24264e2ed0ab522bf183576506efdf5960e602ba.jpeg)

---

<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:** [August 1, 2024, 7:52am UTC](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546/4 "2024-08-01T07:52:49Z")

</div>

In Plots.jl you could use for instance `heatmap()` and simple custom functions to generate equivalent colored bars, but I am not aware of a built-in way:

 ![Plots_GR_colorbars_gradient_fill](https://global.discourse-cdn.com/julialang/original/3X/d/4/d451a25bf8a3a957e483e1a20fce95439dc24b43.png)
