Skip to content
Prev 43501 / 398513 Next

interactive 2-D plot interrogation

On Sun, Feb 01, 2004 at 01:53:14PM -0500, Charles Annis, P.E. wrote:
Look at the InteractiveTkrPlot example on James Wettenhall's site:
http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/InteractiveTkrPlot.html

His example is over discrete set of points, which you can adapt to find the
location with respect to curves or lines (which I did at work, where I can't
get to right now).

The key is that the 'widget' you bind to an event (like left-Mouse in his
example) get (x,y) pixel coordinates from the system which given appropriate
information from par() can be translated into your data coordinates in just
a few steps.

James' site is a treasure chest for R and tcltk. Highly recommended.

Hope this helps, Dirk