Re: [R] why is text being rasterized with text()

From: Andrew Yee <yee_at_post.harvard.edu>
Date: Thu, 03 Apr 2008 07:27:58 -0400

Thank you for looking at my code. You are absolutely right. I'm mortified that I didn't see the text() tucked inside the for loop. Once I took it out of the loop, the text() works fine.

Thanks,
Andrew

On Thu, Apr 3, 2008 at 1:52 AM, Prof Brian Ripley <ripley_at_stats.ox.ac.uk> wrote:
> We haven't been told your OS or the graphics device or how you viewed PDF
> output. But all text on screen devices is rasterized -- they are raster
> devices. (That includes your pdf viewer.)
>
> You are writing the label 9 times in the same place. I suspect what you are
> seeing is a viewer artifact of doing so -- the antialiasing isn't working
> for you.
>
>
>
> On Thu, 3 Apr 2008, Andrew Yee wrote:
>
> >
> >
> >
> > Here's a question: I noticed that when I tried to create this simple
> > graph of rectangles and text, R appears to generate text that is
> > rasterized (this is seen both on the monitor and when the output is
> > directed to a pdf file). Any thoughts?
> >
> > value.seq <- c("<4",as.character(seq(from=4,to=10)),">11")
> > frame()
> > par(usr=c(0,10,0,10) )
> >
> > for (r in 1:9) {
> >
> > rect(r,3,r+1,3.75, border = NA, col=heat.colors(9)[r])
> >
> > #this text does not appear to be rasterized
> > text(r+0.5,2.75, value.seq[r], cex=0.5)
> >
> > #this text appears to be rasterized
> >
> > text(5.5,2.25,"expression (log2)", cex=0.5) }
> >
> > Thanks,
> > Andrew
> >
> > ______________________________________________
> > 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.
> >
> >
>
> --
> Brian D. Ripley, ripley_at_stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>



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 Thu 03 Apr 2008 - 11:45:34 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 Thu 03 Apr 2008 - 13:30:25 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