Write using mouse on R plot?
问题 I created scattergram using the plot() function in R. Is there any possibility to draw on this graph? I would like to add a straight line and get parameters of it, but in my opinion abline() can be inconvenient (I would like to draw many lines and choose one which will be most proper). How can I accomplish this task? 回答1: Take a look at RStudio and this example: library(manipulate) data = matrix(rnorm(20), ncol = 2) example <- function(data, a, b){ plot(data[,1],data[,2]) abline(a = a, b = b)