我正在尝试更改我使用 Plotly Pandas 袖扣调用的图形的图形大小(高度和宽度)。我知道我可以从 plotly.graph_objs 中单独布局,然后给出高度和宽度命令。但是,有没有一种方法可以使用袖扣控制字体和/或图形参数。
我正在绘制 X 轴上股票退市的原因以及 Y 轴上的数量。
这是我的代码
grped = d_list_data.groupby(['Reasons Short']).size()
import cufflinks as cf
grped.iplot(kind = 'bar',
xTitle = 'Reasons for Delisting',
yTitle= 'Count',
title= 'Delisting Reasons since 2001',
theme = 'polar',
)
最佳答案
使用所需的高度和宽度属性定义布局,并在袖扣 iplot 调用中使用它。
layout1 = cf.Layout(
height=300,
width=200
)
grped.iplot(kind = 'bar',
xTitle = 'Reasons for Delisting',
yTitle= 'Count',
title= 'Delisting Reasons since 2001',
theme = 'polar',
layout=layout1
)
https://stackoverflow.com/questions/46016712/