# \[Makie\] Rotate bar plot labels

**URL:** <https://discourse.julialang.org/t/makie-rotate-bar-plot-labels/68679>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [September 24, 2021, 8:50am UTC](https://discourse.julialang.org/t/makie-rotate-bar-plot-labels/68679 "2021-09-24T08:50:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 24, 2021, 8:50am UTC](https://discourse.julialang.org/t/makie-rotate-bar-plot-labels/68679/1 "2021-09-24T08:50:00Z")

</div>

I have a bar-plot:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/1/3172e610cbf50e6c13cf3b725ddadc74d0a53e28.png)

But the labels are hard to read in this orientation. A workaround is to make the plot with `direction = :x`:

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

But is there a way to simply rotate the labels in the first plot?

Code used to create first plot:

```julia
fig, ax, plt = barplot([mean(fc.*(√2, 1/√2)) for fc in centerfrex_octave3rd], octave3rd_rms,
    width=[0.95*fc*(2^(1/6)-1/2^(1/6)) for fc in centerfrex_octave3rd],
    bar_labels = ["fc = $fc" for fc in centerfrex_octave3rd], label_size=15,
    direction=:x,
    flip_labels_at=60,
    axis = (ylabel="Frequency", xlabel="RMS value, dB", title = "Barplot octave3rd-bands, filterorder = $order")
); ax.yscale=log10; ax.xminorticks = IntervalsBetween(4, true); ax.xminorgridvisible=true; ax.xminorgridwidth = 2; ax.xminorticksvisible=true; fig

```

Code for second plot:

```julia
fig, ax, plt = barplot([mean(fc.*(√2, 1/√2)) for fc in centerfrex_octave3rd], octave3rd_rms,
    width=[0.95*fc*(2^(1/6)-1/2^(1/6)) for fc in centerfrex_octave3rd],
    bar_labels = ["fc = $fc" for fc in centerfrex_octave3rd], label_size=15,
    #direction=:x,
    flip_labels_at=40,
    axis = (ylabel="Frequency", xlabel="RMS value, dB", title = "Barplot octave3rd-bands, filterorder = $order")
); ax.xscale=log10; ax.xminorticks = IntervalsBetween(4, true); ax.xminorgridvisible=true; ax.xminorgridwidth = 2; ax.xminorticksvisible=true; fig

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [September 24, 2021, 5:26pm UTC](https://discourse.julialang.org/t/makie-rotate-bar-plot-labels/68679/2 "2021-09-24T17:26:52Z")

</div>

You can always go inside the components of a composite plot like this and change attributes there. So you could go into barplot.plots, find the text plot and change the rotation. This case was simply not considered when writing the recipe I assume

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [October 20, 2021, 2:40pm UTC](https://discourse.julialang.org/t/makie-rotate-bar-plot-labels/68679/3 "2021-10-20T14:40:20Z")

</div>

Did you find a way to do this?

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [October 22, 2021, 8:42am UTC](https://discourse.julialang.org/t/makie-rotate-bar-plot-labels/68679/4 "2021-10-22T08:42:20Z")

</div>

Nope. If I needed it again, I would follow Jule’s suggestion to add the option in the recipe myself - I dont think it would be that hard to add the kwarg to the recipe.
