[R] Plotting series marked with a symbol on every nth data point, preferably in ggplot...

From: Tribo Laboy <tribolaboy_at_gmail.com>
Date: Mon, 25 Feb 2008 13:01:06 +0900


I am working with signals and a plot of several signals on the same axes can get quite messy. With lines that are very fractured, distinction by only the linestyle is not very clear. If I add symbols to the plot however, there are so many symbols, that they overplot and the whole plot is unreadable once again. I am looking for advice on how to make a plot with continuous lines and symbols appearing at every nth point. An example of this problem and a solution in SAS can be found here:

The obvious solution would be to extract the n-th point from the dataset and overplot as a new line with symbols, but this does not change the legend, does it? How can I then have a line+symbol in the legend represent my curve?

Now, ideally I would prefer a solution in ggplot, because of the ease of plotting and changing the plot labels and other properties. However, I remember, Hadley mentioned that he is still working on a new version to have combined line+symbol plots, and probably he hasn't finished that yet. So any advice is welcome.



PS. I did RTFM and I am not posting code, because at this time I expect a general outline how to do it and what commands to lookup, not code.

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. Received on Mon 25 Feb 2008 - 04:09:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Feb 2008 - 06:30:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive