VisPy2 is a high-level scientific plotting producer for GSP scenes.
Figures and axes own semantic plotting state only. Backend selection, capabilities, native
resources, windows, event loops, and displays belong to GSP sessions. VisPy2 depends on gsp-core
and never imports a concrete backend adapter.
Each scene contains explicit full-target panel layout intent. Panels are scene-scoped identities,
visual attachments own clipping scope, and vispy2.EMISSION_FEATURES reports only what this
producer can construct—it never substitutes for renderer session capabilities.
import vispy2 as vp
figure, axes = vp.subplots()
axes.scatter([0, 1], [1, 0])
scene = figure.to_scene()
# Requires the optional Matplotlib provider.
figure.savefig("figure.png")Create a grid, fit its data once, and link programmatic limits:
figure, grid = vp.subplots(2, 2, squeeze=False)
grid[0, 0].hist([1, 2, 2, 3], bins=[0, 1, 2, 3, 4])
grid[0, 1].bar([1, 2], [3, -1])
grid[1, 0].fill_between([0, 1, 2], [0, 1, 0])
for axes in grid.flat:
if axes.visuals:
axes.fit_data()
figure.link_axes(grid[0, 0], grid[0, 1], x=True, y=False)subplots() keeps its single-axes return. Larger grids return an object array, with singleton
rows/columns squeezed by default; squeeze=False keeps two dimensions. Links apply to producer
setters and fitting. Native mouse navigation across linked axes is deferred.
For a static 3D scene, request an Axes3D, add a DATA-space mesh, and fit the semantic camera:
figure, axes = vp.subplots(projection="3d")
axes.mesh(
[[-1, -1, 0], [1, -1, 0], [0, 1, 0]],
[[0, 1, 2]],
color=[70, 130, 220, 255],
)
axes.fit_camera()For bounded DATA-space spheres, use Axes3D.spheres(). Camera fitting includes radii:
figure, axes = vp.subplots(projection="3d")
axes.spheres(
[0.0, 1.0],
[0.0, 0.0],
[0.0, -0.5],
radius=[0.5, 0.25],
color=[[230, 57, 70, 255], [69, 123, 157, 255]],
)
axes.fit_camera()Use an explicit caller-owned session for Datoviz, non-blocking execution, or interactive lifecycle control. See Producer and backend boundary.
For an end-to-end introduction, see the user guide, the public API reference, the installed-wheel gallery, the exact capability matrix, and the interactive project review.
Local wheel commands are in Installation. Contributors should read Developing VisPy2, and user-visible changes are recorded in the changelog.
The matplotlib optional extra names the intended first published rendering combination. Datoviz
remains a development-only provider until an ordinary RC3-compatible dependency artifact exists;
install its locally built adapter wheel and select an explicit GSP_DATOVIZ_SOURCE checkout.
This repository has a fresh history curated from the experimental gsp_vispy2 producer in
vispy/GSP_API. Its source repository is vispy/vispy2; the
package is not yet published.
During this experimental phase, refactor growing implementation modules early. Preserve the public producer API, its tests, and the authoritative GSP contracts while separating figure/layout, 2D axes, 3D axes, conversion, fitting, and scientific geometry. Internal file locations are not compatibility promises; VisPy2 continues to import no concrete adapters.