# Makie.xlabel!

**URL:** <https://discourse.julialang.org/t/makie-xlabel/53905>\
**Category:** New to Julia\
**Tags:** makie\
**Created:** [January 25, 2021, 1:09pm UTC](https://discourse.julialang.org/t/makie-xlabel/53905 "2021-01-25T13:09:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tt1234567](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Post date:** [January 25, 2021, 1:09pm UTC](https://discourse.julialang.org/t/makie-xlabel/53905/1 "2021-01-25T13:09:13Z")

</div>

Makie.xlabel! has stopped working for me after a recent update. For example,

```julia
using Makie
h = Makie.lines(1:10,rand(10))
Makie.xlabel!(h, "label")

```

produces

```julia
ERROR: MethodError: no method matching getindex(::AbstractPlotting.FigureAxisPlot, ::Type{OldAxis})
Stacktrace:
 [1] xlabel!(::AbstractPlotting.FigureAxisPlot, ::String) at C:\Users\ ... \.julia\packages\AbstractPlotting\Gi0Gl\src\shorthands.jl:8
 [2] top-level scope at REPL[5]:1

```

I’m using Julia 1.5.3 in VSCode on Windows 10 with Makie v0.12.0. I’ve tried uninstalling and reinstalling Makie. It was all fine a couple of weeks ago. Is it likely to be a problem with Makie or just my installation?  
Thanks  
Tony

---

<div class="post-metadata">

**Author:** ![tt1234567](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Post date:** [January 29, 2021, 9:27am UTC](https://discourse.julialang.org/t/makie-xlabel/53905/2 "2021-01-29T09:27:05Z")

</div>

It seems I can set the xlabel by

```julia
h.axis.xlabel = "jgjg"

```

but I still can’t get xlabel! to work.

---

<div class="post-metadata">

**Author:** ![czimm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/czimm/32/20380_2.png) [@czimm](https://discourse.julialang.org/u/czimm)\
**Post date:** [April 6, 2022, 9:47pm UTC](https://discourse.julialang.org/t/makie-xlabel/53905/3 "2022-04-06T21:47:41Z")

</div>

So xlabel! still doesn’t work as one would expect in Makie. What’s going on? When running `xlabel("test label")`, this error is returned.

```julia

MethodError: no method matching xlabel!(::String)

Closest candidates are:

xlabel!(::Any, !Matched::AbstractString)

```

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [April 6, 2022, 11:15pm UTC](https://discourse.julialang.org/t/makie-xlabel/53905/4 "2022-04-06T23:15:14Z")

</div>

Seems like a bug in either the documentation or the implementation. It may be worth it to open an issue in the github repository [GitHub - JuliaPlots/Makie.jl: High level plotting on the GPU.](https://github.com/JuliaPlots/Makie.jl)

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [December 6, 2022, 6:22pm UTC](https://discourse.julialang.org/t/makie-xlabel/53905/5 "2022-12-06T18:22:51Z")

</div>

I still hit this error from time to time, so here is the [recommended way](https://docs.makie.org/stable/tutorials/basic-tutorial/#passing_figure_and_axis_styles):

```julia
using CairoMakie
fig, ax, plot = lines(1..10, rand(10); axis = (; xlabel = "x label"))
# or alternatively
ax.ylabel = "y label"

```
