R language 3 curves at the same time to a canvas

    In R language, you can use the "one plot()+multiple lines()" method to draw multiple curves in one canvas. Introduce below, draw 3 curves of inverse proportion y = k/x in a canvas, as follows:

    The R language source code for drawing the curve is as follows:
    //draw.R

x <- seq(100,400,by=1)
y1 <- 40000/x
y2 <- 20000/x
y3 <- 30000/x

plot(y1 ~ x, type = "l",bty="l" ,col="red",xlab = "x", ylab = "y")
lines(y2 ~ x, col = "green")
lines(y3 ~ x, col = "blue")

    The effect is as follows:

Figure (1) The same canvas, 3 curves

Guess you like

Origin blog.csdn.net/sanqima/article/details/114015651