CairoMakie: UndefVarError: Axis not defined

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. 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

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> 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> 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.

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

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.