emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] are babel python sessions and inlined images incompatible?


From: Rodrigo Amestica
Subject: Re: [O] are babel python sessions and inlined images incompatible?
Date: Tue, 23 Apr 2013 18:17:39 -0400
User-agent: SEMI/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/24.2 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Tue, 23 Apr 2013 07:29:50 -0600,
Eric Schulte wrote:
> 
> Rodrigo Amestica <address@hidden> writes:
> 
> > Hello,
> >
> > if I use this block
> >
> > #+BEGIN_SRC python :results file
> > from pylab import *
> > plot(rand(10))
> > savefig('images/test.png')
> > return 'images/test.png'
> > #+END_SRC 
> >
> > then the RESULTS block shows me an inlined version of the plot.
> >
> > If now I switch to this block
> >
> > #+BEGIN_SRC python :session test :results file
> > from pylab import *
> > plot(rand(10))
> > savefig('images/test.png')
> > return 'images/test.png'
> > #+END_SRC 
> >

many thanks for the feed back Eric!

> 
> You don't need to explicitly specify a return when working with a
> session.  Either of the following should work.
> 
>     #+BEGIN_SRC python :session test :file "images/test.png"
>       from pylab import *
>       plot(rand(10))
>       savefig('images/test.png')
>     #+END_SRC
> 

that does not quite work, I get no inlined image but the following line in the
Messages buffer

orgtbl-format-line: Wrong type argument: sequencep, 
<matplotlib\.lines\.Line2DError during redisplay: (wrong-type-argument arrayp 
nil)

> or
> 
>     #+BEGIN_SRC python :session test :results file
>       from pylab import *
>       plot(rand(10))
>       savefig('images/test.png')
>       'images/test.png'
>     #+END_SRC

that one works!

many thanks,
 Rodrigo

> 
> Hope this helps,
> 
> >
> > then the RESULTS block does not show the inlined plot but this
> >
> > | <matplotlib.lines.Line2D | object | at | 0x35c0650> |
> >
> > Using a session is kind of mandatory for me because I need several blocks to
> > share variables.
> >
> > Is there something evidently wrong with my approach?
> >
> > thanks,
> >  Rodrigo
> >
> >
> 
> -- 
> Eric Schulte
> http://cs.unm.edu/~eschulte
> 
> ____________________________________________________________________________________
> Your personal email. Anytime, anywhere.
> Ridiculously affordable at $19.95. No contracts.
> http://www.getpeek.com/lavabit.html
> ____________________________________________________________________________________




reply via email to

[Prev in Thread] Current Thread [Next in Thread]