Skip to content

problems using identify() after plot()

2 messages · Lukas Casier, Greg Snow

#
The problem, as you mention, is that once you create the second plot,
the information from the 1st plot is lost.  One option is to create
the first plot, then convert all the points used to create the first
plot into device coordinates rather than user coordinates (using
grconvertX and grconvertY).  Then you can make the second plot and
have the user click on a point using the locator function.  Convert
the return value from locator with grconvertX and grconvertY to device
coordinates (the device coordinates will remain the same even with
changes in the user coordinates) then find the point from the 1st plot
whose device coordinates are closest to the device coordinates of the
clicked point (this is what identify does automatically, but you will
need to do by hand because of the changes to user coordinates) and
update the second plot accordingly.
On Thu, Feb 6, 2014 at 9:48 AM, Lukas Casier <lukas.casier at gmail.com> wrote: