plotly_build ignores geom_text(vjust)
未關閉
還沒有人認領這個 Issue。
enhancement
ggplotly
- 主要語言
- R
- 星號
- 2.7k
- 分支
- 641
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Hello,
The function plotly_build is very useful for introducing a ggplot in a plotly display. When it's bars, and with a label via geom_text, it doesn't follow the vertical alignment vjust function.
Using this function:
SampleData <- data.frame(Name = c("Peter", "Andrew"), Result = c(6, 9))
SamplePlot <- ggplot(SampleData, aes(Name, Result)) + geom_bar(stat = "identity") +
geom_text(aes(label=Result), color = "white", vjust = 4)
Using only ggplot, the texts are placed below the border:

When I use the plotly_build function that vertical alignement is lost
plotly_build(SamplePlot)
The display is the same as if the vjusthadn't been introduced

貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先重現提供的 SampleData 和 SamplePlot 範例,並執行 plotly_build(SamplePlot)。追蹤 ggplot geom_text 的轉換,重點關注長條標籤的 vjust 處理方式。完成的標準是,建置出的 Plotly 顯示保留 ggplot 中所示的垂直對齊方式。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- r
- 領域
- data-visualization
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100