inline and output

I saw - and happily tested - the new possibility of having inline
figures in the ipython notebooks.

Unfortunately (for my typical usage, in which I both save figures and
show them in the notebook, which is easy with matplotlib and networkx),
it seems like setting the "inline" argument makes the "ouput" argument
irrelevant.

Am I wrong? Is this an intended behaviour?

Thanks,

Pietro

I didn't realize anyone would actually be doing this, but I see no
reason not to. I've changed it now in the git version, so that the
output is no longer ignored with inline == True.

Best,
Tiago

Thanks!

Pietro

Hi Tiago,

> I saw - and happily tested - the new possibility of having inline
> figures in the ipython notebooks.
>
> Unfortunately (for my typical usage, in which I both save figures and
> show them in the notebook, which is easy with matplotlib and networkx),
> it seems like setting the "inline" argument makes the "ouput" argument
> irrelevant.
>
> Am I wrong? Is this an intended behaviour?

I didn't realize anyone would actually be doing this, but I see no
reason not to. I've changed it now in the git version, so that the
output is no longer ignored with inline == True.

There was only a small problem for my typical workflow: I usually
produce figures in pdf, which however raises an error if I set
"inline=True", because it cannot be embedded in the webpage.

I solved this with a patch, that you may want to accept:
https://github.com/count0/graph-tool/pull/5

Another minor annoyance that I found with the inline ability is that it
is different from matplotlib and networkx in the fact that it must be
run as last.

That is, if you run a cell with the following content:

import networkx
g = networkx.random_graphs.complete_graph(5)
networkx.draw(g)
print "ciao"

... in the output you see both "ciao" and the network. If instead you
try

from graph_tool.all import *
g = complete_graph(5)
graph_draw(g, inline=True)
print("ciao")

... in the output you will only see "ciao".

I'm not expert in IPython internals, but I guess it should be simple to
solve.

Pietro

There was only a small problem for my typical workflow: I usually
produce figures in pdf, which however raises an error if I set
"inline=True", because it cannot be embedded in the webpage.

I solved this with a patch, that you may want to accept:
https://github.com/count0/graph-tool/pull/5

It is merged. Thanks!

Another minor annoyance that I found with the inline ability is that it
is different from matplotlib and networkx in the fact that it must be
run as last.

That is, if you run a cell with the following content:

import networkx
g = networkx.random_graphs.complete_graph(5)
networkx.draw(g)
print "ciao"

... in the output you see both "ciao" and the network. If instead you
try

from graph_tool.all import *
g = complete_graph(5)
graph_draw(g, inline=True)
print("ciao")

... in the output you will only see "ciao".

I'm not expert in IPython internals, but I guess it should be simple to
solve.

Yes, the image should be simply displayed instead of returned. I have
fixed this now in git.

Best,
Tiago