import mario

db = mario.load_test("IOT")
fig, data = db.plot(
    matrix="Z", preset="overview", return_data=True,
    auto_open=False, path=False,
)
fig.show()

Result · An interactive figure and its prepared data. path=False skips HTML export; auto_open=False leaves browser opening to you.

Matrix plots and analysis plots#

Focus on one region#

fig = db.plot(
    matrix="Z", preset=None, kind="bar",
    x="Sector_from", color="Sector_to",
    filters={"Region_from": ["Reg1"], "Region_to": ["Reg1"]},
    auto_open=False, path=False,
)
fig.show()

The _from fields describe the rows; _to fields describe the columns. For a SUT use matrix U, with Commodity_from and Activity_to.

Compare scenarios in the same figure

Once a second scenario exists:

fig = db.plot(
    matrix="Z", scenarios=["alternative"],
    base_scenario="baseline", difference="relative",
    preset="heatmap", auto_open=False, path=False,
)

Create it with Apply shocks and compare scenarios.

See db.plot() for presets, axis mappings, filters and export arguments.