How to increase the padding between xticks and xtick labels?

I have a problem, that xticks and xtick labels almost overlap if the ticks face outwards. (It is probably because my xtick labels are like \frac{\pi k}{N}).

eigenmodes-func

How do I increase the padding between the xticks and xtick labels?
I am using Plots with GR backend.

Prepending a carriage return to the xlabel argument string, leaves a blank line in-between the ticks and the label.

For example, xlabel="\nX axis" produces:

1 Like

In Makie, the xticklabelpad Axis attribute controls the space between xticks and xticklabels. Not sure how to do it with Plots with the GR backend :confused:

For finer control of the spacing, we can first plot an empty line label with plots() keyword argument xlabel="\n" and then annotate outside the plot using the plot units:

annotate!([π/2],[-0.2], text("X axis", 11, "Computer Modern"))

to get: