Hi, I would like to produce a plot with a symbol on every nth point in a time series data, like the one in the following: http://www.phon.ucl.ac.uk/home/yi/ProsodyPro/EnglishFocus.png x <- seq(-100,1000,25) plot(x,type="l") Could someone help me out with the above example? Thanks.... [[alternative HTML version deleted]]
Try something like this: plot(x,type="o", pch = c(5,rep(NA,9))) for, e.g., every 10th point. Michael Weylandt On Fri, Oct 21, 2011 at 5:18 PM, zugi young <zugi.young at gmail.com> wrote:> Hi, > > I would like to produce a plot with a symbol on every nth point in a time > series data, like the one in the following: > > http://www.phon.ucl.ac.uk/home/yi/ProsodyPro/EnglishFocus.png > > x <- seq(-100,1000,25) > plot(x,type="l") > > Could someone help me out with the above example? > > Thanks.... > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > 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. >
If you just want the same symbol at each point, you could use Weylandt's approach, tho' personally I think it's tidier to create a new vector x10 <- x[seq(1,length(x),by=10)] and plot that. If you would like a different symbol at each point, then take a look at ?text. <quote> From: R. Michael Weylandt <michael.weylandt_at_gmail.com> Date: Fri, 21 Oct 2011 17:21:34 -0400 Try something like this: plot(x,type="o", pch = c(5,rep(NA,9))) for, e.g., every 10th point. Michael Weylandt On Fri, Oct 21, 2011 at 5:18 PM, zugi young <zugi.young_at_gmail.com> wrote: > Hi, > > I would like to produce a plot with a symbol on every nth point in a time > series data, like the one in the following: > > http://www.phon.ucl.ac.uk/home/yi/ProsodyPro/EnglishFocus.png > > x <- seq(-100,1000,25) > plot(x,type="l") > > Could someone help me out with the above example? -- Sent from my Cray XK6 "Pendeo-navem mei anguillae plena est."