[Solved] more basic R commands than plot [closed]


#margins parameters
mar_save <- par("mar")
par(mar=c(2, 2.3, 0, 0))

#plot windows and initialisation
xmin <- -1
xmax <- 11
ymin <- 0
ymax <- 10
plot(x = c(xmin,xmax), y = c(ymin,ymax),
     xlim = c(xmin,xmax),
     ylim = c(ymin,ymax),
     type = "n",
     xaxs = "i", xaxt = "n",
     yaxs = "i", yaxt = "n")

# axes labels
title(xlab = "xlab", line= 0.8, cex.lab=0.8)
title(ylab = "ylab", line= 1.3, cex.lab=0.8)

#draws points
points(1:10,1:10)

#draws grid
grid(nx = NULL,ny=NULL,col = "grey")

#draws axes with ticks
axis(side = 1L, labels=NA, tick = TRUE)
axis(side = 2L, labels=NA, tick = TRUE)

#draws some y numbers on the ticks
axis(side = 2L, tick = FALSE, line=-0.5, cex.axis=0.7)

#resets margins
par(mar=mar_save)

6

solved more basic R commands than plot [closed]