contour3d

contour3d(x, y, z)

Creates a 3D contour plot of the plane spanning x::Vector, y::Vector, z::Matrix, with z-elevation for each level.

Attributes

Available attributes and their defaults for MakieCore.Combined{Makie.contour3d, T} where T are:

  alpha           1.0
  color           "nothing"
  colormap        :viridis
  colorrange      MakieCore.Automatic()
  depth_shift     0.0f0
  diffuse         Float32[0.4, 0.4, 0.4]
  enable_depth    true
  fillrange       false
  inspectable     true
  levels          5
  linewidth       1.0
  nan_color       RGBA{Float32}(0.0f0,0.0f0,0.0f0,0.0f0)
  overdraw        false
  shininess       32.0f0
  space           :data
  specular        Float32[0.2, 0.2, 0.2]
  ssao            false
  transparency    false
  visible         true

Examples

using GLMakie

f = Figure()
Axis3(f[1, 1], aspect=(0.5,0.5,1), perspectiveness=0.75)

xs = ys = LinRange(-0.5, 0.5, 100)
zs = [sqrt(x^2+y^2) for x in xs, y in ys]

contour3d!(xs, ys, -zs, linewidth=2, color=:blue2)
contour3d!(xs, ys, +zs, linewidth=2, color=:red2)

f

Omitting the xs and ys results in the indices of zs being used. We can also set arbitrary contour-levels using levels:

using CairoMakie

f = Figure()
Axis3(f[1, 1], aspect=(0.5,0.5,1), perspectiveness=0.75)

xs = ys = LinRange(-0.5, 0.5, 100)
zs = [sqrt(x^2+y^2) for x in xs, y in ys]

contour3d!(-zs, levels=-(.025:0.05:.475), linewidth=2, color=:blue2)
contour3d!(+zs, levels=  .025:0.05:.475,  linewidth=2, color=:red2)

f