Plot on all the place of the window

Let do a plot without any margin. The coordinates of the plot area are from 0 to 1 on both x and y axis. It can be changed with the xlim and ylim parameters.

par(mar=c(0, 0, 0, 0))
plot(x=c(0, 1), y=c(0, 1), axes=FALSE, 
        xaxt="n", yaxt="n", main="", 
        xlab = "", ylab = "", 
        xaxs="i", yaxs="i", type="n")

Here is an example on the use:

lines(x=c(0, 1), y=c(1, 0), col="red")
text(x = 0.5, y=0.5, pos=NULL, labels='The center')



Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04