我使用以下代码使用plotly
生成气泡图:
Dataframe.iplot(kind='bubble', x='branch', y='retention', size='active_users', text='active_users',
xTitle='', yTitle='Retention',
filename='cufflinks/PlotName')
我想为Y轴设置手动范围。 任何帮助将不胜感激。
答案 0 :(得分:6)
一种适用于子图的解决方案是:
fig.update_yaxes(range=[0, 0.4], row=1, col=1)
答案 1 :(得分:5)
import plotly.graph_objs as go
layout = go.Layout(
yaxis=dict(
range=[0, 0.4]
)
)
Dataframe.iplot(kind='bubble', x='branch', y='retention', size='active_users', text='active_users',
xTitle='', yTitle='Retention',
filename='cufflinks/PlotName', layout = layout)
这样就可以了。