[Python] How can I plot more than 15 traces using plotly.express.scatter_map?

Discussão em 'Python' iniciado por Stack, Março 11, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to plot data from different platforms on a scatter_map plot animated over time. I am using plotly.express.scatter_map. In particular I want an animation over 1 year of time showing a frame for each day with all available data over the world map for that day.

    The script that I am using is:

    fig = px.scatter_map(
    all_data,
    lon='longitude',
    lat='latitude',
    color='platform',
    title='All Data Over Time',
    zoom=5,
    animation_frame='time'
    )

    fig.update_layout(
    height=700,
    width=1200,
    showlegend=True,
    legend_title_text='Platform',
    legend_traceorder='normal'
    )
    fig.show()


    This is perfectly working when considering a subset of all_data, in particular when I have no more than 15 different platforms in total. The problem is that when I consider my all_data dataset, which consist of data from 19 different platforms, it only shows data from 15 out of the 19 present platforms.

    I believe it is some sort of limitation or default setting of plotly.express.scatter_map, does anyone know if there is a way to overcome this?

    Continue reading...

Compartilhe esta Página