Re: [R] overlapping labels

From: jim holtman <jholtman_at_gmail.com>
Date: Mon, 3 Dec 2007 10:20:23 -0800

You might look at 'jitter' to add a little offset to the labels being plotted.

On Dec 3, 2007 9:21 AM, Biscarini, Filippo <Filippo.Biscarini_at_wur.nl> wrote:
> Good evening,
>
> I am trying to add labels to the point of a simple plot, using the
> text() function; the problem is that sometimes, if two points are too
> close to each other, labels overlap and are no longer readable.
> I was wondering whether there are options that I can use to prevent this
> overlapping (by, for example, placing labels alternatively above and
> below the plotted curve), or whether I should use another set of
> graphical functions (grid or lattice packages).
> Does anybody have suggestions?
>
> Thank you,
>
> Filippo Biscarini
>
> PS: These are the lines of codes that I have been using to generate the
> plot.
>
> plot(
> prova$x,
> prova$y,
> type="b",
> mar=c(0.5,0.5,0.5,0.5),
> xlab="basepairs",
> ylab=""
> );
>
> text(
> prova$x,
> prova$y,
> prova$lab,
> pos=3,
> offset=2,
> cex=0.5
> );
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
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 03 Dec 2007 - 18:30:39 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 03 Dec 2007 - 19:30:17 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.