#16444: ipython notebook
------------------------+----------------------------
Reporter: elixyre | Owner:
Type: task | Status: new
Priority: major | Milestone: sage-6.3
Component: notebook | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
------------------------+----------------------------
The ipython notebook is really simple and ergonomic.
To me the only problem is if we want plot something or show something like
in the sage notebook... That is not easy... and I did find a deterministic
way to plot what I want easily.
For example, if I want plot a tree, I can do that
{{{
from IPython.display import Image, display
file = "/blabla/myfiles/foo/img.png"
b = BinaryTree([[[],[]],[]])
latex.eval(latex(b), locals(), filename=file)
display(Image(filename=file))
}}}
Ok, that is really not sexy but that's work.
One problem is:
{{{
f = x^2 + x + 3
latex.eval(latex(b), locals(), filename=file)
display(Image(filename=file))
}}}
doesn't work!
One has to append `$`:
{{{
latex.eval("$" + latex(f) + "$", locals(), filename=file)
}}}
and ok...
So my questions are:
- what is the good way to do that? (especially, I would like to (re)use
the sage notebook technology)
- Is it possible to add this feature in the ipython patch? I means
something like :
{{{
class SageObject:
...
def _repr_png_(self):
return do_something_to_compute_img_of_self(self)
}}}
(Like in that tutorial:
http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Custom%20Display%20Logic.ipynb)
- and obviously, how to lunch automatically the ipython notebook with the
magic command `%load_ext sage`?
Thanks!
Jean-Baptiste Priez
--
Ticket URL: <http://trac.sagemath.org/ticket/16444>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.