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

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon, 25 Feb 2008 00:05:25 -0500

Try this:

pch <- c("+", ""); lwd <- 1
plot(1:10, type = "o", pch = pch, lwd = lwd) legend("topleft", legend = "data", pch = pch, lwd = lwd)

On Sun, Feb 24, 2008 at 11:01 PM, Tribo Laboy <tribolaboy_at_gmail.com> wrote:
> Hello!
>
> 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:
> www2.sas.com/proceedings/sugi26/p072-26.pdf
>
> 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.
>
> Regards,
>
> TL
>
> 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.
>



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 - 05:11:29 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 - 08: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