[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Matplotlib (Python) plots inline
From: |
Torsten Bronger |
Subject: |
Re: [O] Matplotlib (Python) plots inline |
Date: |
Thu, 09 Jun 2011 09:30:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Hallöchen!
Pierre de Buyl writes:
> I have success with the following:
> #+begin_src python :results output raw :exports results
> import numpy, matplotlib, matplotlib.pyplot
> figure = matplotlib.pyplot.figure()
> axes = figure.add_subplot(111, title=u"Hello", xlabel="x", ylabel="y")
> x = numpy.arange(-10, 10, 0.1)
> axes.plot(x, x**2)
> figure.savefig("/tmp/plot_test.png")
> figure.clf()
> print "[[/tmp/plot_test.png]]"
> #+end_src
>
> You get only the figure as a result, and not the code.
> This method executes the code at each export.
Thanks also for your answer, however, one should write
print "[" + "[/tmp/plot_test.png]]"
or something like this in order to prevent the string literal from
being substituted by the bitmap.
Tschö,
Torsten.
--
Torsten Bronger Jabber ID: address@hidden
or http://bronger-jmp.appspot.com