Dear All, Can R plot graphs like the one at mathwords.com/f/f_assets/floor_graph.gif with the balls at the discontinuity points? Thanks in advance, Paul
Yes ?segments ?points ?pch On 9/27/07, Paul Smith <phhs80 at gmail.com> wrote:> Dear All, > > Can R plot graphs like the one at > > mathwords.com/f/f_assets/floor_graph.gif > > with the balls at the discontinuity points? > > Thanks in advance, > > Paul > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?
On 27/09/2007 8:04 PM, Paul Smith wrote:> Dear All, > > Can R plot graphs like the one at > > mathwords.com/f/f_assets/floor_graph.gif > > with the balls at the discontinuity points?You can use segments() to draw the segments and symbols() to draw the balls. For example, plot(1,1,type='n', xlim=c(1,10), ylim=c(1,10)) segments(1:9, 1:9, 2:10, 1:9) symbols(2:10, 1:9, circles=rep(0.1,9), inches=FALSE, bg="white",add=T) symbols(1:9, 1:9, circles=rep(0.1,9), inches=FALSE, bg="black",add=T) This depends on the order of drawing, because the white background of the first circles obscures the ends of the segments. Duncan Murdoch