plotly / plotly/plotly.R

Italicizing strip.text with ggplotly

Ouverte
#1,812 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
R
Étoiles
2.7k
Forks
641
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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!

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par l’exemple fourni « Free Y Axis » et comparez l’objet ggplot p avec le résultat ggplotly fig, en vous concentrant sur la manière dont le style du texte des bandes de facettes est converti. Reproduisez le style italique manquant pour les libellés de facettes de l’axe y ; le travail est terminé lorsque ggplotly conserve le style italique tout en conservant le texte plus grand de la bande.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
r
Domaine
data-visualization
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.