HMPlot

Scene

The root of a Python display: it holds plots, layouts and inputs and stacks its children top to bottom.

Scatter plot of y against x. x from 0.9 to 4.1, y from 0.9 to 4.1. 4 points. Line chart of y against x. x from 0.9 to 4.1, y from 0.9 to 4.1. 4 rows.

Static preview; loading the interactive plot

import hmplot as hm

data = {"x": [1, 2, 3, 4], "y": [3, 1, 4, 2]}
with hm.Scene() as scene:
    with hm.Plot(data=data, height=300, axes2d=True):
        hm.Points(x="x", y="y")
    with hm.Plot(data=data, height=300, axes2d=True):
        hm.Line(x="x", y="y")
scene

Options

Keywords are snake_case.

gapnumber
Space between the children. Default: 16 px.
themetheme
A theme for everything in the scene: a preset such as hm.themes.dark, hm.create_theme(...), or a definition dict.

Usage

Optional for a single Plot or Facet. Use Scene with Row, Column, or Grid(columns=…) for dashboards. Its batch_update coordinates changes and its export methods compose the display. Svelte applications use normal markup/CSS for this layout.

Related examples

Linked views & minimap