rplot

Text wrap for plot titles


I have a long title for a plot in R and it keeps extending outside the plot window. How can I wrap the title over 2 rows?


Solution

  • try adding "\n" (new line) in the middle of your title. For example:

    plot(rnorm(100), main="this is my title \non two lines")
    

    enter image description here