Skip to content

3D surface plots and shapes

Draw 3D surfaces in Zlv with plot3d, from your own z = f(x, y) formulas to built-in shapes like spheres and tori, then orbit, zoom and export the model.

plot3d draws a surface over a rectangle of x and y values. The result shows as a rotating preview beside the line; click it to open the full 3D viewer.

Plot a surface

Write a formula in x and y, then the x range and the y range:

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Remember that trigonometric functions use degrees by default, so the second surface uses ranges in degrees.

Several surfaces together

Separate formulas with commas. These two halves form a sphere:

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Plot a function of two variables (desktop)

In the desktop app, define a function with two parameters and plot it by name. A two-parameter function is drawn in 3D even with plain plot.

Desktop example
Uses the native Rust engine: copy it into Zlv Desktop to see results.

Results appear next to each line in Zlv Desktop. Download it free.

Built-in shapes and benchmark surfaces

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

ShapeNotes
sphere(r)Sphere of radius r
torus(R, r)Ring with major radius R and tube radius r
cylinder(r, h)Cylinder of radius r and height h
coneCone
mobiusMöbius strip
klein_bottleKlein bottle
helicoid(r)Helicoid
diniDini's surface
heart3dHeart-shaped surface
peaks, sombrero, membrane, monkey_saddle, saddleClassic test surfaces

Using the 3D viewer (desktop)

Click the preview to open the interactive viewer:

  • Drag to orbit around the model, and scroll or use the buttons to zoom. Double-click to reset the camera.
  • Choose a camera preset: Isometric (3D), Top View (XY), Front View (XZ) or Side View (YZ).
  • Switch between Surface, Wireframe and Both, and adjust the surface opacity.
  • Pick a color map such as Viridis, Coolwarm, Plasma, Magma, Turbo or Jet.
  • Toggle the axes, bounding box, contour lines and floor shadow.
  • Hover the surface to read x, y and z coordinates.
  • Copy coordinates as CSV, or open the model in your web browser as an interactive WebGL page.

The rotating side preview can be turned off in Settings > Calculation > 3D plotting & visualization.

All guides