Define fig size with subplot while height is deprecated in layout
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
When using height argument in layout, I have a warning telling that this argument is deprecated.
I can use height in plot_ly function directly which is very fine.
However, when using subplot, I did not find a convenient way to specify the total height for the assembled panels. Should subplot accept its own height and width arguments ?
If I understand correctly, subplot uses by default the layout from one of the contained plots. It seems to be the case for width and height but I find it confusing because:
heightis encouraged to be defined outside of thelayoutfunction- it seems counterintuitive that the size of the panels assembly is controled by the size defined in one subpanel
panel1 = plot_ly(x = 1, y = rnorm(100), height = 600, width = 100) %>%
add_trace(type = "violin")
panel2 = plot_ly(x = 1, y = rnorm(100), height = 300, width = 300) %>%
add_trace(type = "violin")
# Size of individual panels are respected
panel1
panel2
# Total figure size uses size of one subpanel (one can use 'which_layout' to control which)
subplot(panel1, panel2)
subplot(panel2, panel1)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 subplot 和 plot_ly 入口点开始,然后检查 layout dimensions 和 which_layout 当前如何决定组装后 figure 的大小。在提出更改之前,明确 subplot 是否应独立于其 panel 接受 height 和 width,并定义 panel 尺寸冲突时的预期行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100