# Xlabel in Gaston

**URL:** https://discourse.julialang.org/t/xlabel-in-gaston/58773
**Category:** New to Julia
**Tags:** plotting, gaston
**Created:** [April 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/xlabel-in-gaston/58773 "2021-04-07T15:58:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [April 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/xlabel-in-gaston/58773/1 "2021-04-07T15:58:17Z")

</div>

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

```julia
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:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/c/3cda1bc1ec7552fca53953331bb04c5fea2cdcc8.png)  
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?

---

<div class="post-metadata">

### Author: ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)
#### Post date: [April 7, 2021, 5:04pm UTC](https://discourse.julialang.org/t/xlabel-in-gaston/58773/2 "2021-04-07T17:04:58Z")

</div>

Most questions about how to achieve something with Gaston (or Gnuplot.jl) are actually about gnuplot; the manual is [here](http://www.gnuplot.info/docs_5.4/Gnuplot_5_4.pdf).

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.

```julia
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))

```

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

---

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [April 8, 2021, 12:47am UTC](https://discourse.julialang.org/t/xlabel-in-gaston/58773/3 "2021-04-08T00:47:17Z")

</div>

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.  
Please, try:

```julia
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:

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

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

---

<div class="post-metadata">

### Author: ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)
#### Post date: [April 8, 2021, 1:13am UTC](https://discourse.julialang.org/t/xlabel-in-gaston/58773/4 "2021-04-08T01:13:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)
#### Post date: [April 8, 2021, 5:14pm UTC](https://discourse.julialang.org/t/xlabel-in-gaston/58773/5 "2021-04-08T17:14:57Z")

</div>

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