# In a Plots.jl \`bar\` plot, how to remove space between bars?

**URL:** <https://discourse.julialang.org/t/in-a-plots-jl-bar-plot-how-to-remove-space-between-bars/128933>\
**Category:** Visualization\
**Tags:** plots\
**Created:** [May 12, 2025, 8:57pm UTC](https://discourse.julialang.org/t/in-a-plots-jl-bar-plot-how-to-remove-space-between-bars/128933 "2025-05-12T20:57:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [May 12, 2025, 8:57pm UTC](https://discourse.julialang.org/t/in-a-plots-jl-bar-plot-how-to-remove-space-between-bars/128933/1 "2025-05-12T20:57:25Z")

</div>

Here:

```julia
using Plots
vals = [1.0 + rand() for _ in 1:10]
bar(vals)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/e/ce46ea48c53f862cb4f6a5ce96be4dbac140d426.png)

How do I remove the space between the bars (and make them be tight)?

---

<div class="post-metadata">

**Author:** ![eduardovrs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eduardovrs/32/20041_2.png) [@eduardovrs](https://discourse.julialang.org/u/eduardovrs)\
**Post date:** [May 13, 2025, 1:19am UTC](https://discourse.julialang.org/t/in-a-plots-jl-bar-plot-how-to-remove-space-between-bars/128933/2 "2025-05-13T01:19:56Z")

</div>

Hi there,  
you can add `bar(vals, bar_width=1)` and each bar will be next to each other.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/2/5280fd2ed73dfe458879ab69f0880730a7ed645e.png)

Also, you can take a look at more attributes [Bar plot customizations](https://docs.juliaplots.org/stable/gallery/gr/generated/gr-ref056/)  
Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [May 13, 2025, 10:18am UTC](https://discourse.julialang.org/t/in-a-plots-jl-bar-plot-how-to-remove-space-between-bars/128933/3 "2025-05-13T10:18:20Z")

</div>

Works perfectly, thanks a lot!
