go.Indicator
is a gauge chart and has a special attribute domain
that will let you place your indicators within a figure object by specifying x and y
between [0, 1]
. Take a look at Indicators in Python for this example:
Plot

Complete code:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Indicator(
value = 200,
delta = {'reference': 160},
gauge = {
'axis': {'visible': False}},
domain = {'row': 0, 'column': 0}))
fig.add_trace(go.Indicator(
value = 120,
gauge = {
'shape': "bullet",
'axis' : {'visible': False}},
domain = {'x': [0.05, 0.5], 'y': [0.15, 0.35]}))
fig.add_trace(go.Indicator(
mode = "number+delta",
value = 300,
domain = {'row': 0, 'column': 1}))
fig.add_trace(go.Indicator(
mode = "delta",
value = 40,
domain = {'row': 1, 'column': 1}))
fig.update_layout(
grid = {'rows': 2, 'columns': 2, 'pattern': "independent"},
template = {'data' : {'indicator': [{
'title': {'text': "Speed"},
'mode' : "number+delta+gauge",
'delta' : {'reference': 90}}]
}})
And for those who like to study these things in detail:
| The 'domain' property is an instance of Domain | that
may be specified as: | - An instance of
:class:plotly.graph_objs.indicator.Domain
| - A dict of
string/value properties that will be passed | to the Domain
constructor | | Supported dict properties: |
| column | If there is a layout grid,
use the domain for | this column in the grid for
this indicator | trace . | row |
If there is a layout grid, use the domain for | this
row in the grid for this indicator trace . | x |
Sets the horizontal domain of this indicator | trace
(in plot fraction). | y | Sets the
vertical domain of this indicator | trace (in plot
fraction).