Text wrap for plot titles
try adding "\n" (new line) in the middle of your title. For example:
plot(rnorm(100), main="this is my title \non two lines")
You can use the strwrap
function to split a long string into multiple strings, then use paste
with collapse=\n
to create the string to pass to the main title argument. You might also want to give yourself more room in the margin using the par
function with the mar
argument.