0

In the following plot:

enter image description here

How can I break the label text in the right side into two lines? The last one (Total successful redcued tests) is not shown.

The script that I have written is:

ggplot(dataset, aes(Run,value)) + geom_line() + facet_grid(series ~ .,scales="free")+
    scale_x_continuous(breaks = seq(0, 30, 1)) +
    theme(legend.position="none", text = element_text(face = "bold", size = 16), axis.text.x=element_text(angle=90, hjust=1)) + xlab("\nRun") + ylab("Value\n") 

Note that the three labels are the values of the series.

Adam Amin
  • 1,406
  • 2
  • 11
  • 23
  • 3
    Just insert a `\n` into the appropriate place in your `series` values. – Andrew Gustar Sep 02 '19 at 17:54
  • 1
    The addition of `\n` will need to be done in `dataset` itself, such as `transform(dataset, series = sapply(series, function(a) paste(strwrap(a, 20), collapse = "\n")))`. – r2evans Sep 02 '19 at 18:10

0 Answers0