Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Class

go.Isosurface

go.Isosurface creates a 3D Plotly trace for scalar-field isosurfaces. Provide x, y, z, and value arrays, then control the displayed range with isomin and isomax.

How it works

Create a three-dimensional trace from four one-dimensional arrays: x, y, and z locate grid vertices, while value supplies the scalar field. Plotly draws the isosurfaces between the selected isomin and isomax limits; additional trace properties control coloring, contours, caps, and display.

Syntax

go.Isosurface(*arg=None, *autocolorscale=None, *caps=None, *cauto=None, *cmax=None, *cmid=None, *cmin=None, *coloraxis=None, *colorbar=None, *colorscale=None, *contour=None, *customdata=None, *surface=None, *text=None, *uid=None, *uirevision=None, *value=None, *valuehoverformat=None, *visible=None, *x=None, *xhoverformat=None, *y=None, *yhoverformat=None, *z=None, *zhoverformat=None, **kwargs)

Parameters

NameTypeDescription
arg / keyword propertiesobjectOptional constructor and trace properties, including coordinate arrays, scalar values, isosurface limits, and display settings.

Returns

A plotly.graph_objects.Isosurface trace object.

Key points

  • Use the trace to turn a scalar field into interactive three-dimensional isosurface contours.
  • The scalar field is associated with spatial coordinates supplied through x, y, and z.
  • Set surface_count to request multiple levels; the example notes that the default is two surfaces at the minimum and maximum.
  • Colorbar tick configuration can be used so displayed ticks correspond to scalar values represented by the isosurfaces.

Common mistakes

  • Supply matching one-dimensional arrays for coordinates and scalar values; the documented trace represents every vertex in the grid this way.
  • The visible surfaces are bounded by isomin and isomax, so leaving that range unintended can change which contours appear.

Example: Basic isosurface

import plotly.graph_objects as go

fig = go.Figure(go.Isosurface(
    x=[0,0,0,0,1,1,1,1],
    y=[1,0,1,0,1,0,1,0],
    z=[1,1,0,0,1,1,0,0],
    value=[1,2,3,4,5,6,7,8],
    isomin=2,
    isomax=6,
))
fig.show()

Creates an interactive isosurface from coordinates and scalar values, restricted to the range 2 through 6.

When to use it

Scientific field visualization

Explore a scalar field sampled on a 3D grid.

Threshold and contour analysis

Inspect threshold-defined 3D regions interactively.

Multi-level isosurfaces

Show several scalar levels in one figure.

Interview questions

QWhat does go.Isosurface visualize?

go.Isosurface is a Plotly graph-object trace for displaying scalar-field isosurfaces in 3D. It takes x, y, z, and value arrays and draws surfaces between iso-min and iso-max values.

Follow-up: How would you represent the field? Use one-dimensional coordinate arrays and a same-length value array containing the scalar value at each grid vertex.

QWhich options commonly control an isosurface trace?

The constructor accepts trace properties such as isomin and isomax to define the displayed scalar range. It also exposes properties including caps, contour, colorscale, and surface for presentation and geometry controls.

Follow-up: What is the practical consequence of changing the range? It changes which scalar levels are used for the rendered isosurfaces.

QHow is an isosurface displayed in Plotly Python?

The trace is constructed with go.Isosurface(...) and then placed in a go.Figure, as in go.Figure(go.Isosurface(...)). Calling fig.show() renders the interactive chart.

Follow-up: How can presentation be customized without changing the field? Adjust trace properties such as caps, colorscale, contour, or surface settings.

  • plotly.graph_objects.Figure
  • go.Volume
  • go.Mesh3d

Source: plotly.graph_objects.Isosurface — 7.0.0 documentation. Checked 2026-10-15.