# Is it possible to control space from axis to numbers and axis name?

**URL:** <https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678>\
**Category:** New to Julia\
**Tags:** plotting, plots\
**Created:** [June 5, 2025, 6:43pm UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678 "2025-06-05T18:43:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dankelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dankelley/32/33539_2.png) [@dankelley](https://discourse.julialang.org/u/dankelley)\
**Post date:** [June 5, 2025, 6:43pm UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/1 "2025-06-05T18:43:31Z")

</div>

I come to julia from R. In R, my habit is to thin out the margins quite a lot, and snuggle the axis labels in very close to the data area. I know I can alter the margin span, but is there a way I can do this “snuggling” within that area, so I can dedicate as much space as possible to the actual data? (I realize that the defaults are useful for publication, but for earlier analysis stages, I don’t care about aesthetics and just want to see as much of the data detail as I can.)

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 6, 2025, 6:51am UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/2 "2025-06-06T06:51:36Z")

</div>

The answer is probably yes, but which plotting package are you using?

---

<div class="post-metadata">

**Author:** ![dankelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dankelley/32/33539_2.png) [@dankelley](https://discourse.julialang.org/u/dankelley)\
**Post date:** [June 6, 2025, 9:17am UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/3 "2025-06-06T09:17:26Z")

</div>

As a newbie, I’m not too sure how to answer that. I say `using Plots` in my script. If I run it interactively, the plot has “GKS QtTerm” in the title bar, if that’s a clue. I’ve also read that the default is GR, so maybe that’s what I’m using.

As a newbie, I am not really sure how to find what plotting package is being used. I’m sorry to be so ignorant.

PS. I am less concerned with interactive views, than PDF and PNG view created with `savefig()`.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 6, 2025, 10:55am UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/4 "2025-06-06T10:55:49Z")

</div>

> [@dankelley](#):
>
> I say `using Plots` in my script

And that’s the answer right there 🙂

Appreciate that this might be confusing for new users, although it’s pretty much the same in R isn’t it? You say `library(ggplot2)` or `library(plotly)` or whatever to call your favourite plotting library.

I’ve added the `plots` category to your post to hopefully attract a few more experienced `Plots` users, although my gut feel is that this is one of those fine-tuning features that `Plots`, by virtue of being an abstraction over different plotting backends, might struggle with…

If I understand you correctly your issue is that you want to have axis labels closer to the axis itself, which based on a very old GitHub issue doesn’t seem to be possible:

> <https://github.com/JuliaPlots/Plots.jl/issues/1988>
>
> The y-axis label (in GR) is too close to the axis tick labels, and there doesn't… appear to be an attribute to modify this.
> 
> !\[label\](https://user-images.githubusercontent.com/1438610/55741734-f98de480-59fb-11e9-844d-d81b5fedfcd2.png)

(read all the way to the end, which I think is your point)

---

<div class="post-metadata">

**Author:** ![dankelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dankelley/32/33539_2.png) [@dankelley](https://discourse.julialang.org/u/dankelley)\
**Post date:** [June 6, 2025, 11:14am UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/5 "2025-06-06T11:14:05Z")

</div>

Thanks for the tips, Nils, and also for setting the category. Dan.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 6, 2025, 11:51am UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/6 "2025-06-06T11:51:43Z")

</div>

No problem - I should also mention that while `Plots` sounds official and is indeed one of the most popular plotting libraries in Julia, it’s by no means the only option.

[`Makie`](https://docs.makie.org/stable/) often offers much more fine grained control over plots layouts, so worth looking into, and if you come from a grammar-of-graphics background in R take a look at [`AlgebraOfGraphics`](https://aog.makie.org/stable/) which implements this style on top of `Makie`.

---

<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:** [June 6, 2025, 1:11pm UTC](https://discourse.julialang.org/t/is-it-possible-to-control-space-from-axis-to-numbers-and-axis-name/129678/7 "2025-06-06T13:11:09Z")

</div>

You can increase your plot real estate by decreasing the labelling font sizes and rotating them along the y-axis. Try the keyword arguments:  
`tickfontsize=6, labelfontsize=6, yrotation=90`
