# Positioning axis labels in Plots

**URL:** <https://discourse.julialang.org/t/positioning-axis-labels-in-plots/62437>\
**Category:** New to Julia\
**Tags:** plots\
**Created:** [June 5, 2021, 2:02pm UTC](https://discourse.julialang.org/t/positioning-axis-labels-in-plots/62437 "2021-06-05T14:02:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan.phi](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Post date:** [June 5, 2021, 2:02pm UTC](https://discourse.julialang.org/t/positioning-axis-labels-in-plots/62437/1 "2021-06-05T14:02:32Z")

</div>

This might be a very basic question, but how do you right-align the axis labels in a histogram plot? It seems the default is to have them centered, both for the y-axis and the x-axis.

In this simple MWE I would want ` "frequency"` and ` "probability"` to be right-aligned:

```julia
bins = 0:0.05:1
y1 = rand(100)
histogram(y1, ylims = (0,50), ylabel = "frequency", xlabel = "probability"; bins)

```

---

<div class="post-metadata">

**Author:** ![tp2750](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tp2750/32/207806_2.png) [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Post date:** [June 5, 2021, 2:11pm UTC](https://discourse.julialang.org/t/positioning-axis-labels-in-plots/62437/2 "2021-06-05T14:11:11Z")

</div>

Something like this?

```julia

histogram(y1, ylims = (0,50), ylabel = "frequency", xlabel = "probability"; bins, xguidefonthalign = :right, yguidefontvalign = :top)

```

There are more examples in the documentation here: [https://docs.juliaplots.org/latest/generated/gr/#gr-ref54](https://docs.juliaplots.org/latest/generated/gr/#gr-ref54)

![billede](https://global.discourse-cdn.com/julialang/original/3X/1/7/17ece11587faedf1816cc00f84b91a87d1d8c918.png)
