Drawing an ellipse in R

I want to make an ellipse in R. The code is below:

library(car)
A      <- matrix(c(2.2, 0.4, 0.4, 2.8), nrow=2)
ellipse(c(0, 0), shape=A, radius=0.98, col="red", lty=2)

But this code causes the following error:

Error in plot.xy(xy.coords(x, y), type = type, ...) : 
  plot.new has not been called yet

Any help in resolving this issue would be greatly appreciated. Thanks

+1
source share
1 answer

pass an argument add=FALSEand it will create a new schedule instead of trying to add it to an existing one. There is also a package ellipsethat I used if you want another option.

+2
source

Source: https://habr.com/ru/post/1659150/


All Articles