ContinuumIO/bokeh — pull request #606 by damianavila (2014-05-09 14:44:50+00:00)
Title: mplsubplots fix and integration of show_bokeh into mpl.py

OK, this PR fixes the non-working subplots issue... In fact, it was a very problematic issue because some limitations in the mplexporter but, mainly in the matplotlib lib. The main problem comes from the fact you can not instanciate a AxisSubplot independently and then load it to a fig (or there is way, but hacky, faulty and prone to be change it soon because you have use use matplotlib internal functions). So, I solve the issue with our own "hack" and because it is ours, we can control it better.

I essentially pass the fig (containing several subplots) to the `BokehRenderer` and add a "marker" glyph after each subplot (because of the validation step, it has to be a "validated object"... so I use a glyph filled with a dummy datasource to make it identifiable later), which let me, in turn, split the plot.renderers list accordingly to "that" marker and "rebuild" all the available subplots in the proper grid conformation (I know... it is hacky... but I have to confess I enjoy a lot working on this path... anyway, obviously it is widely open to suggestion).

This PR also integrate `show_bokeh` into mpl.py and rename it to `to_bokeh`, so you can easily call it using `mpl.to_bokeh()` which makes more sense and it is nicer than `show_bokeh`.
Finally some other minor fixes in the import ordering and comments.
We can add more thing later, fixes some others, but I want to keep this short... and improve it iteratively...

Thanks.