[IPython-User] Fwd: adding control to notebook
Zoltán Vörös
zvoros@gmail....
Fri Apr 27 01:40:36 CDT 2012
Hi Fernando,
I would just like to comment on one of the aspects that you raised here.
> Of course, if you want to go further, e.g., make the figures also
> interactive, that might be a different issue. Actually, interactive
> figures are something that I miss a bit in the notebook. I see that I
> can use the notebook "outline". I wonder whether this question has
> come up in development. And whether an embeddable terminal, like the
> canvas terminal of gnuplot could be a solution here. In other words,
> what would be easier: make the notebook frontend be aware of a static
> image, with coordinate tracking at least (zooming might be a bit
> harder), or have a terminal based on JS directly from matplotlib? A
> A full blown canvas/js backend for matplotlib would be nice to have,
> but it's a ton of work. We're certainly not the ones who will tackle
> that one.
I will try to look into the canvas terminal, and see what can be done.
In the meantime, I would like to raise a question about the second
option: coordinate tracking might be a bit easier, and it could be used
in other cases as well. What I have in mind is the following: If one has
a png image of the graph, the coordinates of the axes' corners can be
gotten from matplotlib, and then passed to some javascript that would
calculate the data coordinates. Then the ipython notebook can be made
aware of these coordinates, so if there was a way of finding out the
mouse pointer's position relative to the image's bottom left corner,
say, then the coordinates could be printed. Of course, one has to do
some work here, because if the axes are logarithmic or whatnot, then the
conversion has to take care of that, too, but that is minor detail, I
believe. Coordinate tracking would not be constrained to plots, but it
could also be used for some primitive "image processing", e.g., if you
have an image, and just want to know what the RGB value of a certain
pixel is.
Now, the question is whether something like this could relatively easily
be added to the notebook, and if so, where should I look for the entry
point?
Cheers,
Zoltán
More information about the IPython-User
mailing list