簡體   English   中英

將靜態色階設置為 Plotly Heatmap 動畫

[英]Set static colorscale to Plotly Heatmap animation

我創建了一個熱圖動畫,現在我正在嘗試設置色階,以便與幀之間的顏色和值保持一致。 我在這個問題中讀到 cmin 和 cmax 可以完成這項工作,但熱圖沒有這樣的參數。
有沒有其他方法可以獲得相同的結果?

我不知道這是否有幫助,但這是我的情節圖

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM