The documentation example shows that we can create a contour plot with:
using CairoMakie
f = Figure(resolution = (800, 600))
Axis(f[1, 1])
xs = LinRange(0, 10, 100)
ys = LinRange(0, 15, 100)
zs = [cos(x) * sin(y) for x in xs, y in ys]
contour!(xs, ys, zs)
f
However, this example is hard to interpret because there is no way of knowing the value each contour corresponds to. If we add a colorbar it is still not super easy as the continous colorbar confounds the discrete values.
Is it possible to draw more conventional contours with only one color and with the value labeled on top or next to the contour? (the color thing can be achieved by color=:black
Random example I found in the web:
@aramirezreyes I’m running the latest version of CairoMakie and I cannot plot the labels as in your example. Would you or someone else be able to check if they can replicate this please?
(@v1.8) pkg> status CairoMakie
Status `C:\Users\mert4417\.julia\environments\v1.8\Project.toml`
⌃ [13f3f980] CairoMakie v0.9.2
Info Packages marked with ⌃ have new versions available and may be upgradable.
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 16 × 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
Threads: 16 on 16 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS = 16
This was the result of ]status CairoMakie after I’d done ]update CairoMakie to check I was running the latest. Assumed therefore it was the most recent
(@v1.8) pkg> st -m Makie
Status `C:\Users\mert4417\.julia\environments\v1.8\Manifest.toml`
⌅ [ee78f7c6] Makie v0.18.2
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`