ipython-notebook: show picture in notebook (e.g. latex-tikz)

831 views
Skip to first unread message

Daniel Krenn

unread,
Apr 2, 2015, 3:52:08 PM4/2/15
to sage-...@googlegroups.com
The command
view(transducers.GrayCode())
produces tikz-output which can be show by latex. In sagenb this was
shown directly inside the notebook, while in the ipython-notebook this
opens a new pdf with the picture.

It would be nice to have this shown in the ipynb...

Comments? Guesses when this will be possible? Trac-Ticket?

Best wishes,

Daniel

Volker Braun

unread,
Apr 2, 2015, 7:27:19 PM4/2/15
to sage-...@googlegroups.com
I didn't even know that that was possible, yet another way to plot stuff that is not accessible via plot()...

There is no ticket for refactoring view() into something consistent except for the awfully vague #18033. IMHO the finite state machines should go with the program and

* Have plot() produce a Graphics object that contains all of the desired output

* There should be a plot(format='tikz'), or maybe plot(viewer='tikz') etc, that produces tikz+latex from the Graphics object. 

Daniel Krenn

unread,
Apr 3, 2015, 3:52:00 AM4/3/15
to sage-...@googlegroups.com
Am 2015-04-02 um 21:52 schrieb Daniel Krenn:
> The command
> view(transducers.GrayCode())
> produces tikz-output which can be show by latex. In sagenb this was
> shown directly inside the notebook, while in the ipython-notebook this
> opens a new pdf with the picture.

This is now

http://trac.sagemath.org/ticket/18116

Daniel Krenn

unread,
Apr 3, 2015, 3:56:40 AM4/3/15
to sage-...@googlegroups.com
Am 2015-04-03 um 01:27 schrieb Volker Braun:
> I didn't even know that that was possible, yet another way to plot stuff
> that is not accessible via plot()...
>
> There is no ticket for refactoring view() into something consistent
> except for the awfully vague #18033. IMHO the finite state machines
> should go with the program and

Actually, it is a short for

view(latex(transducers.GrayCode()))

also works with

view(latex(transducers.GrayCode()))

So it is the LaTeX output (which is a TikZ-picture) which I want to show.
IMHO...showing any latex-output should work as in the sagenb (i.e. inplace)

> * Have plot() produce a Graphics object that contains all of the desired
> output

This works for the transducers, but gives a different represetnation
(using graphs). The nicly formatted output comes from latex(...)

> * There should be a plot(format='tikz'), or maybe plot(viewer='tikz')
> etc, that produces tikz+latex from the Graphics object.

Ok.

Daniel

Volker Braun

unread,
Apr 3, 2015, 4:05:52 AM4/3/15
to sage-...@googlegroups.com
On Friday, April 3, 2015 at 9:56:40 AM UTC+2, Daniel Krenn wrote:
Actually, it is a short for
  view(latex(transducers.GrayCode())) 
 
I know. And who cares? The important point is to present a uniform user interface for generating graphical output. The _latex_ method of  transducers.GrayCode() re-implements plotting, just in a less flexible way.

Viviane Pons

unread,
Apr 7, 2015, 10:30:58 AM4/7/15
to Sage devel
I'm not sure of what's your point here. Are you saying that the _latex_ method is somehow useless? Because I strongly disagree with that. I use this method a lot for a bunch of objects, and to generate the latex code that then goes into my articles. It is true that it is less flexible than the plot method, so I guess it is just used in different contexts...

 

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Volker Braun

unread,
Apr 7, 2015, 12:13:54 PM4/7/15
to sage-...@googlegroups.com
No, I'm saying its nice functionality but attached at the wrong place. If you can't use .plot() to generate the graphics the how on earth is a new user supposed to discover that functionality? Its just a terrible UI.

Viviane Pons

unread,
Apr 7, 2015, 7:05:06 PM4/7/15
to Sage devel
2015-04-07 12:13 GMT-04:00 Volker Braun <vbrau...@gmail.com>:
No, I'm saying its nice functionality but attached at the wrong place. If you can't use .plot() to generate the graphics the how on earth is a new user supposed to discover that functionality? Its just a terrible UI.

You're right about that! I guess the solution with an optional parameter in the plot function to use the latex instead of default plot would be good. But does view and plot return the same kind of object? I don't think so... That might be a problem!

jplab

unread,
Apr 11, 2015, 2:33:32 AM4/11/15
to sage-...@googlegroups.com
Hi!

I just want to say that this is a very nice feature!!

Jean-Philippe

Jean-Baptiste Priez

unread,
Nov 3, 2015, 12:50:48 PM11/3/15
to sage-devel
Hello tikz lovers!!

I create a(nother) ticket to use tikz picture with jupiter (http://trac.sagemath.org/ticket/19515).
(I don't understand the reason of the ticket  #18116 and it doesn't work on my sage 6.9... )

William Stein

unread,
Nov 4, 2015, 12:24:53 AM11/4/15
to sage-devel
On Tue, Nov 3, 2015 at 9:50 AM, Jean-Baptiste Priez <eli...@gmail.com> wrote:
Hello tikz lovers!!

I create a(nother) ticket to use tikz picture with jupiter (http://trac.sagemath.org/ticket/19515).
(I don't understand the reason of the ticket  #18116 and it doesn't work on my sage 6.9... )


For what it's worth,

view(transducers.GrayCode()) and show(transducers.GrayCode())

just work also in SageMathCloud -- example:


I finally added tikz support a few days ago:

 
Le samedi 11 avril 2015 08:33:32 UTC+2, jplab a écrit :
Hi!

I just want to say that this is a very nice feature!!

Jean-Philippe

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.



--

Jean-Baptiste Priez

unread,
Nov 4, 2015, 3:27:51 AM11/4/15
to sage-devel
Thanks William.

For what it's worth,

view(transducers.GrayCode()) and show(transducers.GrayCode())

just work also in SageMathCloud -- example:


I finally added tikz support a few days ago:


But I am not sure to understand. You develop the functionality for sagemathcloud (which use jupyter, no?) but you don't provide the fix for the current ipython/jupyter notebook?

Jean-Baptiste

Dima Pasechnik

unread,
Nov 4, 2015, 6:04:52 AM11/4/15
to sage-devel
IMHO  it is about Sagecloud worksheets, which have little in common with  jupiter notebook worksheets.


Jean-Baptiste

Daniel Krenn

unread,
Nov 5, 2015, 8:46:44 AM11/5/15
to sage-...@googlegroups.com
On 2015-11-03 12:50, Jean-Baptiste Priez wrote:
> Hello tikz lovers!!
>
> I create a(nother) ticket to use tikz picture with jupiter
> (http://trac.sagemath.org/ticket/19515
> <http://trac.sagemath.org/ticket/19515>).

+1 for making this work in jupiter

> (I don't understand the reason of the ticket #18116 and it doesn't work
> on my sage 6.9... )

FYI, this was the original description of #18116 and motivation for
opening this ticket:

{{{
view(latex(transducers.GrayCode()))
}}}
shows the transducer inplace in sagenb but it is a pitty that this does
not work in the ipython notebook.

Samuel Lelievre

unread,
Nov 8, 2015, 5:31:30 AM11/8/15
to sage-devel
Please everyone write Jupyter with "y" when talking
about Project Jupyter and the Jupyter Notebook.

Read "Where does the name come from" at:
https://github.com/jupyter/design/wiki/Jupyter-Logo#where-does-the-name-come-from

: )

Henri Girard

unread,
Nov 10, 2015, 5:10:48 AM11/10/15
to sage-devel
+1 circuitikz in jupiter
Reply all
Reply to author
Forward
0 new messages