plotly / plotly/plotly.R

Italicizing strip.text with ggplotly

オープン
#1,812 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
R
スター
2.7k
フォーク
641
PR マージ指標
30日以内にマージされた PR はありません

説明

I've been trying to get the labels on a faceted grid to be italicized on the y-axis and can't seem to make it to happen.

Here I'll use the "Free Y Axis" example of a faceted grid as written by Plotly:
https://plotly.com/ggplot2/facet_grid/

The only change I've made to this code is make the strip text for both axes larger and the y-axis text italicized in the ggplot theme().

library(reshape2)
library(ggplot2)
library(plotly)

p <- ggplot(tips, aes(x=total_bill)) + geom_histogram(binwidth=2,colour="white")

# With panels that have the same scaling, but different range (and therefore different physical sizes)
p <- p + facet_grid(sex ~ smoker, scales="free", space="free") +
               theme(strip.text.x = element_text(size = 13),
               strip.text.y = element_text(size = 13,face = "italic"))

p

fig <- ggplotly(p)

fig

The plot produced by ggplot (p) looks like this, with the y-axis facet labels in italics:
image

The plot produced by ggplotly (fig) looks like this:
itali example plotly

Any clarification if I'm missing something would be appreciated. Thank you!

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供されている「Free Y Axis」の例から始め、ggplot オブジェクト p と ggplotly の結果 fig を比較し、facet strip テキストのスタイルがどのように変換されるかに注目してください。y 軸の facet ラベルに欠けているイタリック体のスタイルを再現してください。ggplotly が大きい strip テキストを維持しながらイタリック体の書体も保持すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
r
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。