Home > Software design >  Plot a user-defined equation using R base plots
Plot a user-defined equation using R base plots

Time:11-12

I would like to plot an experimental equation using the base graphics module of R. How can I do it?

The equation is as follows: Y = 0.000028684X^2.907552726

$$\Y=0.000028684*X^2.907552726$$

CodePudding user response:

You can use the text function:

plot(function(X) 0.000028684*X^2.907552726, ylab = 'Y', xlab = 'X',
     xlim = c(0, 100))
text(20, 15, quote(Y == paste('0.000028684')*X^2.907552726))

enter image description here

  • Related