Something like this might help you get started. x <- seq(-5, 5, 1) m <- seq(0.5, 5, 0.5) plot(0, 0, type="n", xlab="", ylab="", xlim=range(x), ylim=range(outer(m, x)+1)) invisible(lapply(m, function(slope) abline(1, slope)))
Jean On Sun, Mar 15, 2015 at 11:03 PM, Partha Sinha <pnsinh...@gmail.com> wrote: > I want to plot a straight line where y=m*x+1 (where x varying from -5 > to +5) and and m will change from 0.5 to 5. All the straight lines > needs to be overlaid. > Thanks > Parth > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.