pandas - 通过在 Pandas 中调用袖扣来改变身材大小

我正在尝试更改我使用 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/

相关文章:

php - Laravel - 如何每分钟运行一个函数/ Controller ? (任务调度)

nginx - 来自 nginx 的 422 状态代码的响应缺少 'Access-Control-A

scala - 为什么我不能在 Scala 中增加?

r - 使用 ggplot 的条形图重新排序无法正常工作

macos - `open -a Chrome` 返回 `Unable to find applic

python - 如何将 '?' 转换为 NaN

python - 是否可以通过 Python 中的另一个字符串列表过滤子字符串列表?

node.js - 如何在 Node.js 中设置文件编码

angularjs - ngrx 参数选择函数

python - 无法将字节连接到 str(转换为 Python3)