Skip to content

Commit

Permalink
Fix #423: Plotly doc (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
figuetbe committed Jun 3, 2024
1 parent 876e393 commit f6d5610
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/visualize/plotly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ It is also possible to combine elements by constructing a
belevingsvlucht.Scattermapbox(
mode="lines",
line=dict(color="#f58518", width=1),
showlegend=False,
)
)

Expand All @@ -96,6 +97,28 @@ It is also possible to combine elements by constructing a
),
)

Or by combining several traces:
.. jupyter-execute::
from traffic.data import airports
from traffic.data.samples import quickstart

subset = quickstart[["TVF22LK", "EJU53MF", "TVF51HP", "TVF78YY", "VLG8030"]]
subset = subset.resample("10s").eval()
assert subset is not None


fig = subset.scatter_mapbox(
color="callsign",
hover_data="altitude",
animation_frame="timestamp",
center=airports["LFPO"].latlon_dict,
)
fig = fig.add_traces(subset.line_mapbox(
color="callsign",
).data)
fig.update_layout(margin=dict(l=0, r=0, t=0, b=0))
fig.show()

Similar functions are available and bound with :func:`plotly.express.line_geo`
and :func:`plotly.express.scatter_geo`:

Expand Down

0 comments on commit f6d5610

Please sign in to comment.