This post has NOT been accepted by the mailing list yet.
i got problems with overlapping labels in a plot.
when i plot the results from a multiple correspondence analysis
most of the points and the assaociated labels overlap, as you can see
in the screenshot posted below.
is there any possibility to move the points?
thanks for your answer. but i do
not really understand how to use the commands.
if i want to use thigmophobe.labels(x,y,) do i need to identify the xy
coordinates for each point first and then manually move every point? and if
i neet to do so how to use the identify() function?
or is there any possibility to automatically place the labels in the best
> Hi Remko,
> thanks for your answer. but i do
> not really understand how to use the commands.
> if i want to use thigmophobe.labels(x,y,) do i need to identify the xy
> coordinates for each point first and then manually move every point? and if
> i neet to do so how to use the identify() function?
> or is there any possibility to automatically place the labels in the best
>> MatArab<- as.matrix(ende[2:12])
>> MCAArab<- mjca(MatArab, nd = 2, lambda = "JCA", maxit = 50, epsilon =
> >plot(MCAArab, dim = c(1,2), map = "symmetric", centroids = TRUE,
> + what = c("none", "all"), mass = c(FALSE, FALSE),
> + contrib = c("none", "none"), col = c("#000000", "#FF0000"))
Looking at your example, it is clear that thigmophobe.labels will not
get all of the labels right. However, it would only be necessary to
manually change a few label positions to get it right. Say your
coordinates are labelled "x" nd "y". First get the offsets:
I count eight labels that need to be moved. Take the two overlapping
labels at about x=c(-0.75,-0.55) and y=c(0.2,0.2). These two will
probably be left overlapping by thigmophobe, probably both with a
textpos value of 4. Change the textpos value of the leftmost label to 2.
Then replot with thigmophobe labels using text.pos=textpos. Do the same
for the other labels until none overlap.
If this is too much trouble, try the spread.lab function in the
TeachingDemos package. It is a better algorithm, but not as easy to call
I ran into a similar problem and wrote a basic package that uses force field simulation to adjust object location. While much improvement is possible, including integration with ggplot, etc. it seems to get the task accomplished. The following illustrates the functionality. If someone runs into the issue and searches for an answer, hopefully this will be of some assistance:
For now there is no intelligent heuristics for a variety of areas and point distributions as I wanted to get something helpful to folks out quickly but I'll add these in the medium term. At this time I recommend scaling charts to 100x100 dimensions and slightly tweaking the default attraction and repulsion parameters as warranted.
On Fri, Jun 28, 2013 at 5:49 AM, kujchoe [via R] <[hidden email]> wrote:
'FField' looks nice but when I try to install the package, I get the following message.
package ‘FField’ is available as a source package but not as a binary
package ‘FField’ is not available (for R version 2.15.2)
Any hint on how I can use FField?
Thanks in advance,
If you reply to this email, your message will be added to the discussion below: