SciTools/iris — pull request #941 by niallrobinson (2014-01-15 13:12:19+00:00)
Title: Class to allow interactive exploration in cube plots

Recovery from mystery cockup here
https://github.com/SciTools/iris/pull/623

INITIAL PR FOR FEEDBACK - DO NOT MERGE

I wasn't getting enough attention on iris-dev so I decided to come and bug you on github instead :stuck_out_tongue_winking_eye:. Hope that's all right.

Problems/questions:
* It takes quite a long time to render a full 145x192 grid. I did a version using matplotlib rather than the iris plot functions and it was much snappier. Not sure what ```iplt``` does to is slowing it up so much. Can ```iplt``` processed images be cached somehow?
* Have I just rewritten the matplotlib animate function by mistake? I've never used it. Would it be useful here?
* I can't figure out how to integrate with ```iris.quickplot```. In particular, the ```_refresh_plot()``` method keeps re-plotting the colour bar.
* I suspect I can streamline some of the matplotlib stuff but this is the first time I've played with the widgets. Do I need to save the buttons in a dictionary, for instance.
* I was experimenting with using to cube_explorer plots simultaneously and it got a little buggy. I think I need to more explicitly tell the plot function which axes to plot to. Unfortunately, I can't find the plot function as a method of the (geo) axes, and I can't figure out how to pass an axes instance to the iplt function.

Here is an example of usage
```python
cube = iris.load_cube(iris.sample_data_path('GloSea4', 'ensemble_001.pp'))

def hook_main(ce):
ce.ax.coastlines()
depth = ce.cube[tuple(ce.current_slice)].coord('depth').points[0]
ce.ax.set_title('%d m' % depth)

def hook_picker(popup_ax, ce):
popup_ax.set_title('Time series')

ce = CubeExplorer(cube, iplt.pcolormesh, [0, slice(None), slice(None)], cmap=mpl_cm.get_cmap('brewer_OrRd_09'), hook=hook_main)
ce.add_nav_buttons(0, ("Up", "Down"), slot=0)
ce.add_animate_buttons(0, ("Play", "Stop"), slot=1)
ce.add_color_range_buttons(("+","-"), 20, slot=2)
ce.add_picker(qplt.plot, hook=hook_picker)
ce.show()
```