Italicizing strip.text with ggplotly
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
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:

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

Any clarification if I'm missing something would be appreciated. Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Free Y Axis example and compare the ggplot object p with the ggplotly result fig, focusing on how facet strip text styling is converted. Reproduce the missing italic styling for the y-axis facet labels; done means ggplotly preserves the italic face while retaining the larger strip text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100