简体   繁体   中英

Set static colorscale to Plotly Heatmap animation

I created a Heatmap animation, now I'm trying to set the colorscale in order to remain consistent with colors and values between frames. I read in this question that cmin and cmax could do the job, but heatmaps have not such parameters.
Is there any other way to obtain the same result?

I don't know if this can be helpful but here's my plotly Figure

framestamps = [go.Frame(data=[go.Heatmap(
    x=lon,
    y=lat,
    z=T_series['thetao'][i],
    colorscale='aggrnyl'
)]) for i in range(300)]


fig = go.Figure(
    data=[go.Heatmap(
        x=lon,
        y=lat,
        z=T_series['thetao'][0],
        colorscale='aggrnyl'
    )],
    layout=go.Layout(
        updatemenus=[dict(
            type='buttons',
            buttons=[dict(
                label='Play',
                method='animate',
                args = [None, {"frame": {"duration": 250,"redraw": True},
                                "fromcurrent": True}],
            )]
        )]
    ),
    frames=framestamps
)

您可以使用zminzmax的参数go.Heatmap

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM