plotly / plotly/plotly.R

Alignment of ggtitle

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

還沒有人認領這個 Issue。

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

描述

First off, thank you for an incredible set of packages!

I'm facing an issue where the ggplot2 title aesthetics are not translated through ggplotyl(); more precisely, the horizontal title adjustment theme(plot.title = element_text(hjust = 0)) is ignored.

Code below:

library(ggthemes)
library(plotly)

set.seed(12345)
v <- runif(100, min=0, max=100)
df <- as.data.frame(v)
names(df) <- c("pressure")

t <- ggplot(df, aes(x = pressure)) +
  geom_histogram(bins = 20, alpha = 0.7, position = "identity") +
  scale_fill_fivethirtyeight(label = comma) +
  theme_tufte(base_size = 7, base_family = "Avenir") +
  labs(x =  "pressure", "# observations", title = "pressure plot") +
  theme(plot.title = element_text(hjust = 0)) +
  theme(axis.ticks = element_blank()) +
  scale_x_continuous()
(gg <- ggplotly(t))

Is there another way to define the location of text elements? Thanks!

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

首先執行提供的 R 範例,並檢查產生的 ggplotly 標題對齊方式是否符合 ggplot2 主題設定。追蹤標題的水平調整如何被轉換,然後確認轉譯後的標題遵循 hjust = 0,同時不破壞標題的其他定位方式。

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

評估

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

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

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