'In ggplot2 , how to align label x text in vertical
Solution 1:[1]
Try this:
library(tidyverse)
category <- c("A B C", "DF GC", "S AA")
amount <- c(3, 2, 1)
plot_data <- data.frame(category, amount)
plot_data %>%
mutate(category = str_wrap(category, 1)) %>%
ggplot(aes(category, amount)) +
geom_col()

Created on 2022-05-07 by the reprex package (v2.0.1)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Carl |

