# CairoMakie: UndefVarError: Axis not defined

**URL:** <https://discourse.julialang.org/t/cairomakie-undefvarerror-axis-not-defined/94367>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [February 9, 2023, 5:33pm UTC](https://discourse.julialang.org/t/cairomakie-undefvarerror-axis-not-defined/94367 "2023-02-09T17:33:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aquarelleX332](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquarellex332/32/21048_2.png) [@aquarelleX332](https://discourse.julialang.org/u/aquarelleX332)\
**Post date:** [February 9, 2023, 5:33pm UTC](https://discourse.julialang.org/t/cairomakie-undefvarerror-axis-not-defined/94367/1 "2023-02-09T17:33:15Z")

</div>

Hello dear all,

Julia-1.8.5  
Makie v0.19.2  
CairoMakie v0.10.2

I am trying to learn the basics of Makie according to the [basic tutorial](https://docs.makie.org/stable/tutorials/basic-tutorial/). After installation:

> julia\> using CairoMakie  
> julia\> f = Figure(resolution = (400, 400))  
> julia\> ax = Axis(f[1,1])  
> ERROR: UndefVarError: Axis not defined

I also noted a warning:

> WARNING: using Makie.Axis in module Main conflicts with an existing identifier.

I think that this warning is due to the fact that I installed PGFPlotsX which I use very often (Axis is also used by PGFPlotsX).

Many thanks in advance for any help.  
Thierry

---

<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:** [February 9, 2023, 5:48pm UTC](https://discourse.julialang.org/t/cairomakie-undefvarerror-axis-not-defined/94367/2 "2023-02-09T17:48:32Z")

</div>

This will happen if you are using both plotting packages in the same session.

One possible solution is to qualify the name by the module.

```julia
julia> using PGFPlotsX
julia> using CairoMakie
julia> f = Figure(resolution = (400, 400))
julia> ax = CairoMakie.Axis(f[1,1])

```

If you don’t want to type the full name of the package everytime you can make an alias:

```julia
julia> using PGFPlotsX
julia> using CairoMakie
julia> const cm=CairoMakie
julia> f = Figure(resolution = (400, 400))
julia> ax = cm.Axis(f[1,1])

```

Other option is not using both plotting packages in the same session.

---

<div class="post-metadata">

**Author:** ![aquarelleX332](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquarellex332/32/21048_2.png) [@aquarelleX332](https://discourse.julialang.org/u/aquarelleX332)\
**Post date:** [February 9, 2023, 6:00pm UTC](https://discourse.julialang.org/t/cairomakie-undefvarerror-axis-not-defined/94367/3 "2023-02-09T18:00:44Z")

</div>

> [@aramirezreyes](#):
>
> This will happen if you are using both plotting packages in the same session

Indeed. You are right. And the conflict is nom resolved. Many thanks! 🙂

---

<div class="post-metadata">

**Author:** ![aquarelleX332](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquarellex332/32/21048_2.png) [@aquarelleX332](https://discourse.julialang.org/u/aquarelleX332)\
**Post date:** [February 9, 2023, 9:06pm UTC](https://discourse.julialang.org/t/cairomakie-undefvarerror-axis-not-defined/94367/4 "2023-02-09T21:06:49Z")

</div>

Perhaps, one more question concerning GLMakie and in particular, wireframe.

In 3D wireframe graphs, how to do in order to change the axis for example:  
x into φ  
y into θ  
z into Y(θ,φ)

An instruction like:

> wireframe(θ, φ, Y(θ,φ), axis=(type=Axis3,), color=:blue)

does not change the name of x-, y- or z-axis

Thank you in advance.
