From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id ICksEgAmpWRwCQEASxT56A (envelope-from ) for ; Wed, 05 Jul 2023 10:12:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mAhJEQAmpWSPJAEAG6o9tA (envelope-from ) for ; Wed, 05 Jul 2023 10:12:48 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CDB8E21790 for ; Wed, 5 Jul 2023 10:12:47 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=BzIGnO6j; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688544767; a=rsa-sha256; cv=none; b=p4YrSV+nVIRz1dN4HGqs2fv19UZVEU2jfFgjnfnkO5irGFFPOTP++c2zHDu8AzFzKWRb1b l/+5zvhOxmLzjS+OF4f187kJDDHsOIhK0gJLlBkTcxchZEQ02Dzn6xBlNaW0Bakt3iY/aC lRCB+gKYFWe0M23yp4tsdd1tLWZe/i/2r0PQVxWvstee6K4tPGEl/K4Ml/VZTQFPgo6mBg zaT2jgAUlxYFPGIoGTcfRm0uIC/D8s3gsKYhDv2q6wpPhnE7DmTg9+2DPWDwFhlyZ87aqm sZkxbq98F9ybxR+a8/kqjrysH1OAftncdyTe9KTGLBTFuscys1azrZxWvEiOIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=BzIGnO6j; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688544767; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=q/jgjzegC/EO2tHR+mzwJ+REErtBrL/yvwjR4veZFAM=; b=LV/ImdWPrldbNC+/2UhFMHzuY3AlUUcu0bKP1J6wzGwKUoJ5PTW5IMkX7svnohAPMmwmJ+ AMg1uKH78jvqQS3eilnPUDUTNUGgKisWCEmNgAJD5o2N/IlduyqY1gskl9QHj0gnfHGaLL U8ELrKt1X/Rh9VmFrwTjSni2oD3iFH0LBDDn6nFX3bcYs7zqwhd6xTTz5X1/IQkh7lHZYG u+iHhsjt14uNRzE3gIViuZkvgIfHEcs841t65iDn7BN5PGmuxgRcft0sozmSK4r1MxgzVE WaiZoT4fqpBOzM+hPfcKfxO0sMm0QAnmvjK7iqD6L2Uu/qvN20GoUbLUCR1X9w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGxcU-0001v0-GO; Wed, 05 Jul 2023 04:12:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGxcR-0001uE-Uw for emacs-orgmode@gnu.org; Wed, 05 Jul 2023 04:12:11 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGxcQ-0006Zi-BM for emacs-orgmode@gnu.org; Wed, 05 Jul 2023 04:12:11 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-19a427d7b57so4205743fac.2 for ; Wed, 05 Jul 2023 01:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688544729; x=1691136729; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=q/jgjzegC/EO2tHR+mzwJ+REErtBrL/yvwjR4veZFAM=; b=BzIGnO6jn2fvx7uE7zrZWWxr1fVSiz2imt9BlwPmCqiJPCV5eCf6oavCHsW6ppPnvk CbdxGwQe0GVjbqf4XKl/2irbjRXxUwxq8WOdpIIwXXYwg4m4dXgdJK17lDOle0W3iz3i FCb5GOYLtXpwJC/lkohFdSf5sQ1JxgYe9RzjTa4Y66M6bYJ1BhlkKngyRuyx/uQw9D+8 B9f5roDdSu4V6z9LOimzGsswNx03GRcZg+IGtC3fOeP96IXvVKDyOQEANwzbCpPAUhhN OcwhqzOU8fq3ndwoI2lqVzncNl3vkjcx0qDXcWnom8lZXVC19s+R0TlG7WwBZ3e3BXeY yO+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688544729; x=1691136729; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q/jgjzegC/EO2tHR+mzwJ+REErtBrL/yvwjR4veZFAM=; b=Bk4bPMNQ8LZQMRFJguhdeL3ezyTmW9H3SZKyeCluSrhKVPMI4DGp9gnfHGdeQCiOBE FrBzBcYKN7zfU7g8JUNahThsyHnccpFxu3LjVg610MInwsCFLNXMBFg+LrRNrR49Qy0V eTul/8By9h01DYLnsVw2UMDDjZ72r/bBGJiJNVR+J043X6rGcvUSnagCNIEXXY1l8W1y sKbjaOvGbRAYH/9WT3I9Dm6vulI7dKA1K3a7rkkjf7AtiVdYkkbSsDdJNdyYLEGLZmGr hvpi1nkip8sXnxNa/hi/xZBoVyM/AHgg9Ji21++/B+/il8ro6cDFyUPZ9AJd0XVcSpJT k8ag== X-Gm-Message-State: ABy/qLa1XgXQBQYjQeiVdj2616jG3lbaiy587FwqppzKqTl/tu8Etpgf Jp5NIqGSWc9O7xEulmHWo8igVL8NMGgH+SEQm7U= X-Google-Smtp-Source: APBJJlGvYd63jLN9C4959vTiE6SrlatLS6jGYcbGM2X3tA0wpYZWKrd2QtDTV0quLKVVILR/PPqFjLKsXh+LqqJRULs= X-Received: by 2002:a05:6871:84c7:b0:1b0:454b:1c3d with SMTP id sw7-20020a05687184c700b001b0454b1c3dmr11295722oab.36.1688544728963; Wed, 05 Jul 2023 01:12:08 -0700 (PDT) MIME-Version: 1.0 References: <87y1jv0wlx.fsf@gmail.com> In-Reply-To: <87y1jv0wlx.fsf@gmail.com> From: Liu Hui Date: Wed, 5 Jul 2023 16:11:57 +0800 Message-ID: Subject: Re: [PATCH] ob-python: support header argument `:results file graphics' To: Jack Kamm Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=liuhui1610@gmail.com; helo=mail-oa1-x35.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.43 X-Migadu-Queue-Id: CDB8E21790 X-Spam-Score: -6.43 X-TUID: YtfNt2EnYHoc Jack Kamm =E4=BA=8E2023=E5=B9=B47=E6=9C=885=E6=97=A5= =E5=91=A8=E4=B8=89 13:13=E5=86=99=E9=81=93=EF=BC=9A > 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.