Italicizing strip.text with ggplotly
Nessuno ha ancora preso questa issue.
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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:

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

Any clarification if I'm missing something would be appreciated. Thank you!
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l'esempio fornito „Free Y Axis“ e confronta l'oggetto ggplot p con il risultato di ggplotly fig, concentrandoti su come viene convertito lo stile del testo delle strisce delle facet. Riproduci lo stile corsivo mancante per le etichette delle facet dell'asse y; il lavoro è completo quando ggplotly conserva lo stile corsivo mantenendo il testo più grande della striscia.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- r
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100