小编Sam*_*uru的帖子

Plotly:如何使所有地块灰度化?

我正在使用 Plotly 在 Python 中生成一些线图。使用这样的示例代码:

from plotly import offline as plot, subplots as subplot, graph_objects as go
  
fig = subplot.make_subplots(rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.01)
trace1 = go.Scatter(x = [1, 2, 3], y = [1, 2, 3])
trace2 = go.Scatter(x = [1, 2, 3], y = [4, 5, 6])
fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 2, 1)

config_test_plot = {'displaylogo': False, 'displayModeBar': False, 'scrollZoom': True}
test_plot_html = plot.plot(fig, output_type='div', include_plotlyjs=False, config= config_test_plot)
Run Code Online (Sandbox Code Playgroud)

我能够获得所需的图。但是,我希望能够以灰度方式获取所有绘图。我看到 Plotly 默认主题都不是这种类型。无论如何我可以做到这一点吗?

python python-3.x plotly plotly-python

2
推荐指数
1
解决办法
423
查看次数

标签 统计

plotly ×1

plotly-python ×1

python ×1

python-3.x ×1