# Xlabel in Gaston

Dear all,
i have this code to plot a paramatrized surface:

``````using Gaston

Θ = LinRange(0, 2π, 100) # 50
Φ = LinRange(0, π, 20)
r = 0.8
x = [r*cos(θ)*sin(ϕ) for θ in Θ, ϕ in Φ]
y = [r*sin(θ)*sin(ϕ) for θ in Θ, ϕ in Φ]
z = [r*cos(ϕ)        for θ in Θ, ϕ in Φ]

surf(x, y, z, w = :l, lc = :turquoise,
Axes(xlabel=x, view = "equal xyz", pm3d = "depthorder",hidden3d = :on,key = :off))
``````

Whose result is the following:

However, I would like to insert the labels (eg, xlabel=x,ylabel=y,m zlabel=z) on axis and controls the distance between the tick labels.
How can I do this?

Most questions about how to achieve something with Gaston (or Gnuplot.jl) are actually about gnuplot; the manual is here.

In the case of axis labels, these have to be given as strings or symbols. As for the “distance between tick lables”, I’m not sure what this means exactly. In the code below, I specify the tics, tic labels, and position in a couple of different ways.

``````surf(x, y, z, w = :l, lc = :turquoise,
Axes(xlabel = :x, ylabel = :y, zlabel = :z,
xtics = "-0.6,0.4,0.6 offset 0, -0.75",
ytics = """("-0.5" -0.5, "0.0" 0, "+0.5" 0.5) offset 1.25""",
view = "equal xyz",
pm3d = "depthorder",
hidden3d = :on,
key = :off))
``````

1 Like

Thank you very much.
Other question: How can I modify the size of my figure in the console (the blanck area)? Eg, the relative position of my picture and the area?
I have noted that in all figure the blanck are the same.

``````surf(x, y, z, w = :l, lc = :turquoise,
Axes(xlabel = :x, ylabel = :y, zlabel = :z,zrange= "[*<0:1<*]",xrange= "[*<-1:1<*]",yrange= "[*<-1:1<*]",
#view= "60, 45, 1, 1",
xtics = """("-0.5" -0.5, "0.0" 0, "+0.5" 0.5) offset -2.25""",
ytics = """("-0.5" -0.5, "0.0" 0, "+0.5" 0.5) offset 2.25""",
view = "60, 45, 0.7, 2.1",
size = "1,2",
xyplane = "at 0",
#pm3d = "depthorder",
hidden3d = :on,
key = :off))
``````

and you can see:

Two options: reduce the figure (preserving the proportions) or increase the blanck area.

I would try using gnuplot’s `size` setting; page 193 in the manual.

Would you like to adapt this code for a nonrectangular domain?