Say I make a scatterplot with thousands of points:
ggplot(head(data, n=2000), aes(length, coverage))+
geom_point(alpha = 0.5, color = 'navyblue') + coord_trans(x='log', y='log')
alt text http://fourmidable.unil.ch/temp/scatterplot.png
I want to add the labels of "the 20 or so most extreme points" (in the upper right and bottom right corners). They are easy to identify visually. But getting at them programatically seems a bit of a burden. (requiring many if statements).
Is there any way I can click on R's graphic output to obtain their precise coordinates?
Thanks, yannick
The grid analogue (the ggplot2 package as well as the Lattice package are based on grid graphics) of locator() is grid.locator().
Thanks to Deepayan Sarkar Lattice Book !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With