gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
in ggplot, how to bold the title from facet_wrap?
- User
in ggplot, how to bold the title from facet_wrap?
- Assistant
To bold the title from facet_wrap in ggplot2, you can use the theme() function to modify the appearance of the text.
Here is an example:
library(ggplot2) # Create a sample data frame data <- data.frame( x = rnorm(100), y = rnorm(100), group = rep(c("Group A", "Group B"), 50) ) # Create a scatter plot with facet_wrap p <- ggplot(data, aes(x = x, y = y)) + geom_point() + facet_wrap(~ group) # Modify the appearance of the facet titleLabel p + theme(strip.text = element_text(face = "bold"))In this example, the strip.text argument in the theme() function is used to modify the appearance of the facet title text. The "bold" argument is passed to the face parameter to make the text bold.