From f6d56103d2d8d25ecb715a5c38709c994e4a40f4 Mon Sep 17 00:00:00 2001 From: Benoit Figuet <35493466+figuetbe@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:16:34 +0200 Subject: [PATCH] Fix #423: Plotly doc (#446) --- docs/visualize/plotly.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/visualize/plotly.rst b/docs/visualize/plotly.rst index a9caacae..6477710a 100644 --- a/docs/visualize/plotly.rst +++ b/docs/visualize/plotly.rst @@ -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, ) ) @@ -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`: