简体   繁体   中英

Dynamic range for y axis (Plotly - Python)

When I put autorange bar graph shows not as good as posible. Then I decided to put fixed range, but my graph sometimes out of y axis. So I want to put dynamic range [0, df['yaxis'][-1] + 500]. It shows error: like it is out of band.

layout = plotly.graph_objs.Layout(
barmode=‘group’,
bargap=0.15,
bargroupgap=0.1,
yaxis={‘range’:([0, cumulative_df[‘max’][-1] + 500])}
)

How to do it dynamically?

Pandas在用于Y的数据框中的特定值列中具有带有max()函数的此选项。随着数据框的变化,范围也会变化。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM