plotly可视化绘制多子图(subplots)共享坐标轴
Posted Data+Science+Insight
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了plotly可视化绘制多子图(subplots)共享坐标轴相关的知识,希望对你有一定的参考价值。
plotly可视化绘制多子图(subplots)共享坐标轴
# 共享坐标轴
import plotly as py
import plotly.graph_objs as go
pyplt = py.offline.plot
trace1 = go.Scatter(
x=[1, 2, 3],
y=[2, 3, 4]
)
trace2 = go.Scatter(
x=[20, 30, 40],
y=[5, 5, 5],
xaxis=\'x2\',
yaxis=\'y\'
)
trace3 = go.Scatter(
x=[2, 3, 4],
y=[600, 700, 800],
xaxis=\'x\',
yaxis=\'y3\'
)
trace4 = go.Scatter(
x=[4000, 5000, 6000],
y=[7000, 8000, 9000],
xaxis=\'x4\',
yaxis=\'y4\'
)
data = [trace1, trace2, trace3, trace4]
layout = go.Layout(
xaxis=dict(
domain=[0, 0.45]
),
yaxis=dict(
domain=[0, 0.45]
),
xaxis2=dict(
domain=[0.55, 1]
),
xaxis4=dict(
domain=[0.55, 1],
anchor=\'y4\'
),
yaxis3=dict(
domain&
以上是关于plotly可视化绘制多子图(subplots)共享坐标轴的主要内容,如果未能解决你的问题,请参考以下文章
plotly可视化绘制多子图(subplots)并自定义坐标轴
Python可视化matplotlib多子图可视化(Multiple Subplots):plt.axes()plt.subplot()plt.subplots()