簡體   English   中英

全局更改為通用默認顏色 plotly #444

[英]global change to the universal default color of plotly #444

當前,如此處所述,軌跡、邊框、刻度、輪廓等的默認顏色為 #444。 有沒有人找到一種方法來更改此默認設置,而不是指定要更改的每個功能?

您可以開始定義您想要的模板。 然后你應該添加template=template到你想要應用這些設置的所有地塊:

import plotly.express as px
import plotly.graph_objs as go

# Create the template
# Put this block in the top of your file
template = go.layout.Template(
    layout=go.Layout(
        paper_bgcolor="#333333",
        plot_bgcolor="#333333"
    )
)


fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16], template=template)
fig.show()

暫無
暫無

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

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