plotly / plotly/plotly.R

subplot - merging titles following ggplotly conversion

未關閉
#1,990 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
R
星號
2.7k
分支
641
PR 合併指標
30 天內沒有已合併 PR

描述

data(faithful)

p1 <- plotly::ggplotly(
  ggplot(faithful, aes(x = eruptions)) + 
    geom_histogram(bins = 20) + 
    theme_minimal()  + 
    labs(title = "A.")
)

p2 <- plotly::ggplotly(
  ggplot(faithful, aes(x = waiting)) + 
    geom_histogram(bins = 20) + 
    theme_minimal()  + 
    labs(title = "B.")
)

pl <- subplot(p1, p2, nrows = 1, titleX = TRUE)

## note  that changing to labs(tag = "A.") results in loss of the 'tag' at the ggplotly function.  

I am creating a gglot (histogram, in this case) which includes a sub-panel label. I want to then convert to a plotly figure using the plotly::ggplotly function. The label is transmitted faithfully to each of p1 and p2. However, when combining these into a subplot, the label seems to be merged . I lose the 'A.' label on the first plot p1, generally. The titleX option does not prevent this from occurring.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先從使用 ggplotly 和 subplot 的可重現 faithful 資料範例開始,接著追蹤在啟用 titleX 時 subplot 如何組合 p1 和 p2 的標題。確認 labs(title = "A.") 和 labs(title = "B.") 的行為;轉換與組合後兩個標籤仍保持可見即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
r
領域
data-visualization
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。