leouieda/fatiando — pull request #69 by leouieda (2013-11-12 18:48:41+00:00)
Title: Changed behaviour of interactive funcs in vis.mpl

The functions where using pyplot.show() to stay open while the user
picks points, etc. This causes a problem when the plot is interactive
and pyplot.show() doesn't hold the execution (e.g., in IPython with -pylab).
In those cases, the functions returned empty lists because no points had
been picked yet.

The alternative is to return a function instead of the picked points,
etc. This function returns what has been picked when it is called. So in
interactive mode, after the picking is done, just call the function
returned to get the values:

from fatiando.vis import mpl
area = [0, 1, 0, 2]
mpl.figure()
getpoints = mpl.pick_points(area, mpl.gca())
points = getpoints()

TODO:

- [] Update any modules that used the old functionality
- [] Update docs
- [] Update recipes