I think you can use something like this:
#+BEGIN_SRC python :results output file :var fname="test.png"
import matplotlib.pyplot as plt
import io
f = io.StringIO()
plt.plot([1, 2, 3, 17])
plt.savefig(fname)
print(fname, end='')
#+END_SRC
It is in Python3.
John
--
Hello again,
stardiviner writes:
> Roger Mason writes:
>
>> Hello,
>>
>> I want to output the result of the evaluation of a (python) source block
>> to a (graphics) file and have a link to the file inserted in the buffer.
>
> For this, you should try updated header arguments like ":results grap
Hello,
Ken Mankoff writes:
>
> What about :var file="scaleplot02.pdf".
That was my starting point, but the resulting link is prefixed by ':'
Perhaps I should upgrade org.
Cheers,
Roger
Hello,
stardiviner writes:
> Roger Mason writes:
>
>> Hello,
>>
>> I want to output the result of the evaluation of a (python) source block
>> to a (graphics) file and have a link to the file inserted in the buffer.
>> #+begin_src python :results value file :file scaleplot02.pdf :exports
>> r
Norman Walsh writes:
> Gustav Wikström writes:
>> I propose a "document" element in org-element, a property-drawer on
>> document-level, a setting-drawer on document-level and
>> property-keywords (slightly different than what already exist). And
>> would like your comments regarding tha
Hi again,
This became a bit long, so the most important thing is repeated here
in the top:
I think there is merit to the idea of a file/document/buffer being
seen as a level-0 node. I think we'd benefit by adhering to the
principles for outline nodes also for the document-node (level-0 node)
as m