plotly可视化绘制多子图(subplots)并自定义子图

Posted Data+Science+Insight

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了plotly可视化绘制多子图(subplots)并自定义子图相关的知识,希望对你有一定的参考价值。

plotly可视化绘制多子图(subplots)并自定义子图

# 多子图(subplots)并自定义子图

from plotly import tools
import plotly as py
import plotly.graph_objs as go

pyplt = py.offline.plot


trace0 = go.Scatter(
    x=[1, 2],
    y=[1, 2]
)
trace1 = go.Scatter(
    x=[1, 2],
    y=[1, 2]
)
trace2 = go.Scatter(
    x=[1, 2, 3],
    y=[2, 1, 2]
)
fig = tools.make_subplots(rows=2, cols=2, specs=[[{}, {}], [{\'colspan\': 2}, None]],
                          subplot_titles=(\'First Subplot\',\'Second Subplot\', \'Third Subplot\'))

fig.append_trace(trace0, 1, 1)
fig.append_trace(trace1, 1, 2)
fig.append_trace(trace2, 2, 1)

fig[\'layout\'].update(showlegend=False, title=\'Specs with Subplot Title\')
pyplt(fig, filename=\'subplot_specs1.html\')

以上是关于plotly可视化绘制多子图(subplots)并自定义子图的主要内容,如果未能解决你的问题,请参考以下文章

plotly可视化绘制多子图(subplots)并自定义坐标轴

plotly可视化绘制多子图(subplots)共享坐标轴

可视化神器Plotly玩转多子图绘制

Python可视化matplotlib多子图可视化(Multiple Subplots):plt.axes()plt.subplot()plt.subplots()

plotly可视化绘制双子图(subplots)

R可视化ggplot2绘制多子图