# Rotating the axis label in GR makes the label go out of the plot

**URL:** <https://discourse.julialang.org/t/rotating-the-axis-label-in-gr-makes-the-label-go-out-of-the-plot/111672>\
**Category:** General Usage\
**Tags:** plotting, gr\
**Created:** [March 15, 2024, 5:10pm UTC](https://discourse.julialang.org/t/rotating-the-axis-label-in-gr-makes-the-label-go-out-of-the-plot/111672 "2024-03-15T17:10:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archisman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/archisman/32/51867_2.png) [@archisman](https://discourse.julialang.org/u/archisman)\
**Post date:** [March 15, 2024, 5:10pm UTC](https://discourse.julialang.org/t/rotating-the-axis-label-in-gr-makes-the-label-go-out-of-the-plot/111672/1 "2024-03-15T17:10:45Z")

</div>

Here is my code

```julia
using Plots
using LaTeXStrings
a = randn(100,1);
b = sin.(a);

scatter(a,b,xlabel=L"x",ylabel=L"\sin(x)",
        framestyle = :box,
        legend=false,
        yguidefontrotation = -90
)

```

The label “sin(x)” goes outside the plot region.

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

* * *

If I use `pyplot()`, then the label rotates, but it does not use the LaTeX font anymore, so using `pyplot()` is not an option.

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

---

<div class="post-metadata">

**Author:** ![archisman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/archisman/32/51867_2.png) [@archisman](https://discourse.julialang.org/u/archisman)\
**Post date:** [March 15, 2024, 8:41pm UTC](https://discourse.julialang.org/t/rotating-the-axis-label-in-gr-makes-the-label-go-out-of-the-plot/111672/2 "2024-03-15T20:41:45Z")

</div>

I found a workaround. `using Plots.PlotMeasures` and `left_margin` works.

```julia
using Plots
using Plots.PlotMeasures
using LaTeXStrings
a = randn(100,1);
b = sin.(a);

scatter(a,b,xlabel=L"x",ylabel=L"\sin(x)",
        framestyle = :box,
        legend=false,
        yguidefontrotation = -90,
        left_margin = 35 px
)

```
