【发布时间】:2018-12-15 01:22:48
【问题描述】:
我刚刚安装了最新的 Plotly (3.0),但无法设置图例文本颜色。
这是我的代码:
import plotly.graph_objs as go
import numpy as np
x = np.random.randn(1000)
y = np.random.randn(1000)
fig = go.FigureWidget({'x':x,'y':y,'type':'histogram2dcontour','colorscale':'Viridis'}],
layout=go.Layout(title='test',width=700,plot_bgcolor='rgba(0,0,0,0)',
paper_bgcolor='rgba(0,0,0,0)'))
fig.layout.titlefont.color = 'orange'
fig.layout.xaxis.color = 'white'
fig.layout.yaxis.color = 'white'
fig.layout.legend.font.size = 2000
fig.layout.legend.font.color = 'red'
fig
如下所示,下面的图例文本保持不变。奇怪的是 fig.layout.legend.font.color 的属性包括大写、isdigit 类方法等。
这是一个错误还是我遗漏了什么?
非常感谢任何帮助。
谢谢。
【问题讨论】: