Adjust plot title (main) position

前端 未结 3 1464
眼角桃花
眼角桃花 2020-12-02 18:18

I have been unable to find a way to adjust the (vertical) distance between plot and main title in R using par. In this example:

plot(1, 1, main = \"Title\")
         


        
3条回答
  •  没有蜡笔的小新
    2020-12-02 19:05

    Try this:

    par(adj = 0)
    plot(1, 1, main = "Title")
    

    or equivalent:

    plot(1, 1, main = "Title", adj = 0)
    

    adj = 0 produces left-justified text, 0.5 (the default) centered text and 1 right-justified text. Any value in [0, 1] is allowed.

    However, the issue is that this will also change the position of the label of the x-axis and y-axis.

提交回复
热议问题