How to split the Main title of a plot in 2 or more lines?

后端 未结 3 1072
温柔的废话
温柔的废话 2020-12-13 09:25

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



        
相关标签:
3条回答
  • 2020-12-13 09:35

    I had the opposite problem : how to pass from a three line title to a one line title. To solve that, you just add to concatenate your paste vectors as follow:

    plot(1, main=c(paste("X:",1," ","Y:", 2),paste("Z:",3)))
    

    0 讨论(0)
  • 2020-12-13 09:41
    plot(1, main=paste("X:",1," ","Y:", 2," ","\nZ:",3))
    
    0 讨论(0)
  • 2020-12-13 09:48

    Like this:

    plot(1)
    title(main="This is \nTitle")
    

    Edit:

    Try this

    plot(1, main=paste("X:",1," ","Y:", 2," ","\nZ:",3))
    
    0 讨论(0)
提交回复
热议问题