I've got a database containing languages, their longitudes and latitudes and a feature value (either category 1, category 2 or both - in the plot these are marked red, blue and green respectively). There may be up to three points per language and naturally two language points may lie very close to each other.
name longitude latitude sp_sum1 Modern Armenian 45 40 both2 Modern Armenian 45 40 both3 Modern Armenian 45 40 spatial4 Dieri 138 -28.1667 both5 Dieri 138 -28.1667 both6 Finnish 25.5577 64.7628 non-spatial7 Crimean Tatar 28.1418 43.8398 spatial8 Ese Ejja -67.515 -11.7268 non-spatial9 Makhuwa 38.8052 -14.8509 non-spatial...I'm using the R package ggplot2 (and I'd be happy to keep using it as I am particularly familiar with it). Here's a crop from a previous attempt (code: see bottom of page 1):
For every point, I'd like the (rough) position - as well as the value - still to be visible. (If there are multiple points for a single language, they may be combined.)
Is there a way either...
Feel free to ask for clarification. I am aware that there have been a number of questions on overplotting, but those that I have looked into all seemed to be have a different (i.e. statistic) purpose (I don't however claim to have read it all, so I'd be happy to accept a link as well, of course).
1 The following lines of code created the crop from above.
library(OpenStreetMap)library(ggplot2)data
name longitude latitude sp_sum1 Modern Armenian 45 40 both2 Modern Armenian 45 40 both3 Modern Armenian 45 40 spatial4 Dieri 138 -28.1667 both5 Dieri 138 -28.1667 both6 Finnish 25.5577 64.7628 non-spatial7 Crimean Tatar 28.1418 43.8398 spatial8 Ese Ejja -67.515 -11.7268 non-spatial9 Makhuwa 38.8052 -14.8509 non-spatial...I'm using the R package ggplot2 (and I'd be happy to keep using it as I am particularly familiar with it). Here's a crop from a previous attempt (code: see bottom of page 1):
For every point, I'd like the (rough) position - as well as the value - still to be visible. (If there are multiple points for a single language, they may be combined.)
Is there a way either...
- ... to move points to the side just enough so that there is no overplotting (less randomly than, say, by using geom_jitter - there is a lot of this kind of dodging in the beeswarm package for example, but that again seems only to apply to scatterplots)?
- ... and/or to have some kind of "line" pointing to the original position of a point if it had to be moved?
- ... or to combine close-by points in a way that they are still clear (there is probably a working technique out there that uses binning, i.e. stat_bin* or something with a similar effect)?
- ... or to create an "interactive plot" like those seen on websites that still can be included into a pdf (I'm thinking also about the abilities of packages like animation and shiny here)? For example, it looks like this on wals.info:
Feel free to ask for clarification. I am aware that there have been a number of questions on overplotting, but those that I have looked into all seemed to be have a different (i.e. statistic) purpose (I don't however claim to have read it all, so I'd be happy to accept a link as well, of course).
1 The following lines of code created the crop from above.
library(OpenStreetMap)library(ggplot2)data