我正在使用 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 默认主题都不是这种类型。无论如何我可以做到这一点吗?