Is there a way to add padding between axis ticks and axis label in Plots.jl with gr?

Hi all!

I’m using the GR backend to create a plot. The axis label is written with a LatexString, but for some reason, there is almost no space between the tick labels and the axis label. I’ve been trying for a while to find a solution but couldn’t. Is there a simple way to deal with this situation?

Thank you!

Edit - my plotting environment looks like this:

using Plots
using LaTeXStrings
using Distributions

#Plotting function with latex string
function plot_normal(mu, sigma, label_x)
    x = range(mu - 4*sigma, stop=mu + 4*sigma, length=1000)
    y = pdf(Normal(mu, sigma), x)
    plot(x, y, label="", linewidth=2)

#LateX string label
label_x = L"Normal Distribution: $x$"

plot1 = plot_normal(0, 1, label_x)

plot2 = plot_normal(5, 2, label_x)

#Main plot
combined_plot = plot(plot1, plot2, layout=(1, 2), size=(800, 400))

As simple as adding a carriage return and margins:

using Measures, LaTeXStrings, Plots; gr()
plot(sin, xlabel="\nx^2", margins=5mm)

Sadly this doesn’t work. Maybe because I have multiple figures? The margins seems to add space between the labels and the edges of the entire figure space. Am I doing something wrong?

Yes, not providing a MWE.

Sorry, I added.

Please try the following additions/changes to your code:

using Measures
label_x = "\n" * L"Normal Distribution: $x$"
combined_plot = plot(plot1, plot2, layout=(1, 2), size=(800, 400), bottommargin=7mm)