[R] Overplotting: plot() invocation looks ugly ... suggestions?

Constantinos Antoniou constantinos.antoniou at gmail.com
Wed Jul 26 12:02:44 CEST 2006


Hello,

I would like to make a question regarding the use of a grey background
(by ggplot in this case, but also in other settings - I seem to
remember a relevant lattice discussion). It seems that it is generally
discouraged by journals. I guess one practical reason is that it makes
photocopying difficult (in the sense that it may lead to low contrast
situations). It might have to do with printing costs, as it leads to
higher coverage of the page, but I do not know about that.

[Disclaimer: it does look nice, though.]

Any comments?

Thanks,

Costas

On 7/26/06, hadley wickham <h.wickham at gmail.com> wrote:
> > And if lattice is ok then try this:
> >
> > library(lattice)
> > xyplot(Consumption ~ Quarter, group = Year, data, type = "o")
>
> Or you can use ggplot:
>
> install.packages("ggplot")
> library(ggplot)
> qplot(Quarter, Consumption, data=data,type=c("point","line"), id=data$Year)
>
> Unfortunately this has uncovered a couple of small bugs for me to fix
> (no automatic legend, and have to specify the data frame explicitly)
>
> The slighly more verbose example below shows you what it should look like.
>
> data$Year <- factor(data$Year)
> p <- ggplot(data, aes=list(x=Quarter, y=Consumption, id=Year, colour=Year))
> ggline(ggpoint(p), size=2)
>
> Regards,
>
> Hadley
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list