[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ob-python: support header argument `:results file graphics'
From: |
Liu Hui |
Subject: |
Re: [PATCH] ob-python: support header argument `:results file graphics' |
Date: |
Wed, 5 Jul 2023 16:11:57 +0800 |
Jack Kamm <jackkamm@gmail.com> 于2023年7月5日周三 13:13写道:
> 1. Do you need to add a call to pyplot.gcf().clear(), in case of
> multiple blocks in a session?
I don't think so. Some users may want to keep the figure between
blocks, and they can always clear the figure themselves when
necessary.
> 2. Would it make sense to wrap in pyplot.rc_context, so that we can use
> the :width and :height arguments like ob-R? E.g.,
>
> with pyplot.rc_context({'figure.figsize': (8,5)}):
> pyplot.plot([1,2,3,4,5])
> pyplot.gcf().savefig('filename.png')
>
> Will create a png file with width 8 and height 5.
Thanks for your suggestion and I have added some arguments (e.g. :dpi)
in the updated patch. But rc_context doesn't work reliably with
multiple blocks in a session, i.e., the figure size may not change.
BTW, I have updated the patch to turn off the feature by default,
since it may break existing src blocks using `graphics'. WDYT? Thanks.
- Re: [PATCH] ob-python: support header argument `:results file graphics', (continued)
- Re: [PATCH] ob-python: support header argument `:results file graphics', Ihor Radchenko, 2023/07/07
- Re: [PATCH] ob-python: support header argument `:results file graphics', Jack Kamm, 2023/07/08
- Re: [PATCH] ob-python: support header argument `:results file graphics', Ihor Radchenko, 2023/07/09
- Re: [PATCH] ob-python: support header argument `:results file graphics', Jack Kamm, 2023/07/12
- Re: [PATCH] ob-python: support header argument `:results file graphics', Ihor Radchenko, 2023/07/12
- Re: [PATCH] ob-python: support header argument `:results file graphics', Jack Kamm, 2023/07/13
- Re: [PATCH] ob-python: support header argument `:results file graphics', Liu Hui, 2023/07/05
Re: [PATCH] ob-python: support header argument `:results file graphics', Jack Kamm, 2023/07/05
Re: [PATCH] ob-python: support header argument `:results file graphics', Jack Kamm, 2023/07/05
- Re: [PATCH] ob-python: support header argument `:results file graphics',
Liu Hui <=