How can I shorten x-axis label text in ggplot?
问题 I'm making a plot in ggplot where the x-axis labels contain the names of different proteins, and I'm having trouble because some of these names are too long and the labels becomes so big that it is hard to see the plot. Instead of "printing" a bigger graph, there is any way to reduce the number of characters in the x-axis labels? Here's an example that shows my problem: library(ggplot2) dat <- mtcars # Make the x-axis labels very long for this example dat$car <- paste0(rownames(mtcars)