mpld3/mplexporter — pull request #6 by theengineear (2014-02-28 07:18:46+00:00)
Title: PlotlyRenderer, draw_text in minimal working order

Jake,

I've been working on getting annotations to come up right in plotly. Here's where I'm at right now.

Couple of suggestions:

- When mplexporter passes the 'xlabel', 'title', and 'ylabel', objects, it should pass the font characteristics as well (size, color, etc). You can check out how I did it (just as a proof of concept) below. I basically filtered through the children for the xaxis and yaxis until I matched the string that mplexporter passed for the xaxis and yaxis. Then I parsed through the Text object for the desired properties.

- Plotly likes annoations to be in data coordinates. When Exporter makes a draw_text call to plotly, it gives the transform, coordinates, and the position. However, the transform (i think?) puts the coordinates into DISPLAY coordinates. It doesn't give the renderer a way to go back into data coordinates. I used the _current_ax from the base renderer class to sort this one out, but maybe mplexporter should deal with this differently.

Cheers,

Andrew