emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] ob-python: support header argument `:results file graphics'


From: Ihor Radchenko
Subject: Re: [PATCH] ob-python: support header argument `:results file graphics'
Date: Mon, 03 Jul 2023 11:41:31 +0000

Liu Hui <liuhui1610@gmail.com> writes:

> I have updated the patch and ‘:file’ header argument can be omitted
> now, e.g.
>
> #+begin_src python :results graphics file
> import matplotlib.pyplot as plt
> plt.plot([1,2,3,4,5])
> plt.savefig('test.png')
> return 'test.png'
> #+end_src

This already works, even without the patch.

> In this case, `graphics' can be removed too.

May you elaborate?

#+begin_src python :results file
implies that the result of execution is file _contents_.

>> What if the user wants to use, for example, pyplot instead of
>> matplotlib?
>
> pyplot is a module of matplotlib. If you mean users want to use other
> graphics libraries, they may advise `org-babel-python-save-graphics'
> if they want to use `graphics' in the header argument. If necessary,
> ob-python may support such libraries too.

This is not acceptable. If src blocks worked in the past, they should
continue working without adjustments in user' setup. We can only break
backwards-compatibility when there is a strong reason to do so. Adding a
new feature is not such a reason.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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