[IPython-dev] Fwd: notebook plots via javascript

Zoltán Vörös zvoros at gmail.com
Mon Jun 4 08:48:05 EDT 2012


Greetings Ludwig,

Thanks for the comments! Below are mine.
>
> You might find the mplh5canvas backend 
> (http://code.google.com/p/mplh5canvas/) interesting. It is a JS 
> backend for matplotlib
I have seen this, in fact, about a month ago, it was I who suggested 
this to Fernando, but he convinced me that in the notebook one might 
want to have something different.

The first problem was the reliance on an external server. This could, of 
course, be fixed, at the expense of putting some extra load on the 
ipython kernel.

Second, for what I had in mind, a static javascript with basic 
functionalities, like coordinate reporting, grid toggling, and zooming 
should do. An example of this could be gnuplot's canvas terminal. 
http://gnuplot.sourceforge.net/demo_canvas_4.6/

I would bring two arguments in favour of a static file. First, if the 
plot does not require a server to run, then it can also be used in a 
static notebook, when you just save the notebook in html, and then open 
it on a computer that doesn't even have ipython installed. I think this 
is an advantage that should not be underestimated.

Second, I believe, the plot should not allow the user to significantly 
change the plot, e.g., removing data points and so on is probably not a 
good idea, because then the plot will be decoupled from the underlying 
code that generated it. (NB. zooming is already questionable in this 
regard.) One can go down that path, but that's a different paradigm, 
found in Origin and the like. However, if all one wants can be 
implemented in static code, why not implement it in static code? So, why 
I certainly see the enormous potential of the html5 backend, I am not 
convinced that that is the best option in the case at hand.

Well, these were my comments. Anyone else to chip in?

Best,
Zoltán
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120604/d32c6d63/attachment.html>


More information about the IPython-dev mailing list