Is it possible to split the main title of a plot() in 2 or more lines in R?
Moreover I have a title which consists of many argumenets pasted together
plot(1, main=paste("X:",1," ","Y:", 2," ","Z:",3))
How can I insert a line break between Y and Z in the main?
Thanks E.C
When displaying text on plots, "\n" is typically interpreted as '\' followed by 'n' instead of the newline character. To generate multiple lines, use cell arrays. This is done by separating each string line of text with a comma and enclosing all comma-separated strings in curly braces as follows.
Click the chart, and then click the Chart Design tab. Click Add Chart Element > Axis Titles, and then choose an axis title option. Type the text in the Axis Title box. To format the title, select the text in the title box, and then on the Home tab, under Font, select the formatting that you want.
Like this:
plot(1) title(main="This is \nTitle")
Edit:
Try this
plot(1, main=paste("X:",1," ","Y:", 2," ","\nZ:",3))
plot(1, main=paste("X:",1," ","Y:", 2," ","\nZ:",3))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With