Visualizations Terminus
Layout properties
The title, width, height, margin, and position can be changed with these layout properties.
Sample data
Let's import PlotAPI and load our sample data.
from plotapi import Terminus
links = [
{"source":"England", "target":"Germany", "value": 1000},
{"source":"England", "target":"France", "value": 3000},
{"source":"England", "target":"Spain", "value": 5000},
{"source":"England", "target":"Italy", "value": 4000},
{"source":"England", "target":"Japan", "value": 800},
{"source":"Ireland", "target":"Germany", "value": 3500},
{"source":"Ireland", "target":"France", "value": 3750},
{"source":"Ireland", "target":"Spain", "value": 1750},
{"source":"Ireland", "target":"Italy", "value": 5000},
{"source":"Ireland", "target":"Japan", "value": 400},
]
Demonstration
We can modify the width, margin, and rotation of our diagram.
We can modify the width, height, and margin of our diagram.
The margin is a single float value that is applied as an equal margin of that size.
To include a diagram title, we can pass the desired string into the title parameter.
By default a Termninus diagram is centered, but this can be disabled with center=False.
With layout properties
Terminus(
links,
width=800,
height=500,
margin=100,
title="PlotAPI Terminus with a Title",
).show()