Saturday 15 May 2010

r - Time lapse plotting -


I am new to R environment. I have created a simulated time-lapse plot using the following code.

  seq_x & lt; -seq (1,10) seq_y & lt; -function (y) {z> & lt; -y ^ 2 + y + 1 (1: Return to length (seq_x)) (c (z)) yrange & lt; -seq_y (1) yrange [2] & lt; -seq_y (length (seq_x)) {xdata & lt; -seq_x [1: i] Ydata & lt; -seq_y (xdata) plot (xdata, ydata, xlim = range (seq_x), ylim = range (yrange), type = "o", col = "royalblue", plot.first = grid ()) Sys.sleep (1 }}  

I get the following conspiracy (after the last iteration). Enter image details here

Now let me plot a straight line and a circle right The plot is shown as below.

enter image details here

data sequence to straight line Should grow with. The circle data should be at the center of the specification, with the user specified radius. Any advice in this regard will be highly appreciated.

Try it:

  # draw circle is required ( PlotTricks) UserRedias & lt; - Draw 1 Caracal (middle (xdity), median (ydata), userreadias) #draw line segments (x0 = xdata [1], y0 = ydata [1], x1 = xdata [length (xdata)], y1 = ydata [length ( Ydata)])  

No comments:

Post a Comment