bug boxplot set to horizontal
還沒有人認領這個 Issue。
- 主要語言
- R
- 星號
- 2.7k
- 分支
- 641
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Hi, I've found a bug in ggplotly() when I want to draw an horizontal boxplot. The code that doesn't work is this:
au2= ggplot(data) + geom_boxplot(aes_string(x = "Conc", y ="Class"))+
labs( x = "log2(Concentration)", title = "Density boxplot")
plotly::ggplotly(au2)
where "Conc" is continous and "Class" is discrete. ggplot correctly draw the graph, but when I use ggplotly(), the plot is almost empty (becomes empty if I put also fill = "Class")
in ggplot works fine:

in plotly doesn't work:

If I reverse x and y everything works fine but the boxplot will be vertical. So in order to make an horizontal boxplot that kinda works in plotly I have to use coord_flip() in ggplot2. So this code:
au2 = ggplot(box_data) + geom_boxplot(aes_string(y = "Conc", x ="Class")) +
labs( x = "log2(Concentration)", title = "Density boxplot") + coord_flip()
plotly::ggplotly(au2)
But I have a last problem with ticks. They are a bit rotated:
problem with ticks in plotly:

What's happening??
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先使用 ggplot()、geom_boxplot() 和 plotly::ggplotly() 重現回報的水平箱型圖,並比較直接的水平映射與 coord_flip() 替代方案。調查連續軸與離散軸、fill 以及刻度標籤的處理;當水平箱型圖能正確渲染 fill 且其刻度方向符合預期時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- r
- 領域
- data-visualization
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100