From xie at yihui.name  Tue Oct 22 17:14:48 2013
From: xie at yihui.name (Yihui Xie)
Date: Tue, 22 Oct 2013 10:14:48 -0500
Subject: [Rd] png(type='cairo'): point symbols without boarders are not
	anti-aliased?
In-Reply-To: <BAEDB1D6-7221-4940-9C6D-E4D39946C1BC@r-project.org>
References: <CANROs4eMXzueFLzoeAs7OyRgUMj6fv9jcLZ-GQZd=hxx4jB4nQ@mail.gmail.com>
	<5265AA74.4080509@stat.auckland.ac.nz>
	<CANROs4cOqL2H1XX5iKJKAKdv6TmCT-6S=-Csu+x+uUam6LNX-w@mail.gmail.com>
	<BAEDB1D6-7221-4940-9C6D-E4D39946C1BC@r-project.org>
Message-ID: <CANROs4dw1rpQY4SBEaVOf7=x7E41KZWwE4wpjdByeWsU4x+VcA@mail.gmail.com>

Thanks for the hints! I was originally wondering the difference
between grDevices::png(type='cairo') and Cairo::CairoPNG() for the
case pch=16, a solid point without border. Cairo does a nice job for
such point symbols, but png() renders them very poorly.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Oct 22, 2013 at 9:09 AM, Simon Urbanek
<simon.urbanek at r-project.org> wrote:
> The Cairo package does "smart" anti-aliasing - it aligns lines that are perpendicular to the axes such that they centered at pixels. That avoids the anti-aliasing effects that Brian was talking about for the heatmap example. This enables Cairo to have full anti-aliasing support and still render heatmaps without artifacts.
>
> However, there is no way around the anti-aliasing artifacts if you use arbitrary polygons without borders. For example:
>
> library(deldir)
> plot(c(-1,1),c(-1,1),ty='n')
> for(p in tile.list(deldir(rnorm(200),rnorm(200)))) polygon(p$x,p$y,col=heat.colors(15)[runif(1,1,15)], border=NA)
>
> That said, in our experience the Cairo approach works very well in practice.
>
> Cheers,
> Simon



[Rd] png(type='cairo'): point symbols without boarders are not anti-aliased?
Yihui Xie