From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 CGOsEOn3pGSOygAASxT56A (envelope-from ) for ; Wed, 05 Jul 2023 06:56:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sJF2EOn3pGSgpwAAauVa8A (envelope-from ) for ; Wed, 05 Jul 2023 06:56:09 +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 B978A1BA64 for ; Wed, 5 Jul 2023 06:56:08 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=RGFXFcau; 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=1688532969; a=rsa-sha256; cv=none; b=AzBeFvQ5X57Hvipvx1W8Q0v8v+LU4tyJzoeZinjNLlwyZlKB6S1wFXowQgAEl9pJcwi5h8 PBQMlKttt4RW7VkWcWyH7a+sAZxjiIenbfIZqFprQur9BMg7YjP696pN1w6yMYsQcnShd/ lWxgOScicsnPU4neL1XbEG2v854DHo1hA8go7PFXAKntVPkTirCe5/rsOXGv8ApdVkjHL9 OKbIFQttlMmDkBHCMNNKDZOH5y2qKOfKKBj1hXViRs+xMeSGBsCPdEE858HuFnPJqr21ZN Nf9nYBVZhDv1LJ0s3zt7PLldF7FcbYf6fjq+ggIXXLm1FQEBroRKGuXkhCQ0YQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=RGFXFcau; 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=1688532969; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=HV8Xo28AErc4ZJSjeqe9dkp8NxdMXA70IlAVatKro1g=; b=ETDWVY+d8LZOuvoWInOz4q1bAe13zodFCXmpf2uLd5WkcyKsl2hsi6mpDoTqFMezybBv+F 5AnPO9i2PUHWx9fJBoNz/muuQJOniwSDSrGeO2SrG4jOCprZa3tiBx2aP/07d7ht7V2nB7 J/oxuVwiW59vi3wNYSNSunSnX4VkKEKx52MwRgFpu+33XUtmQL0LW4o7JBokQsWtYgj5oq VVjMC91lWyPvofpe6Gv514uyckxtN/5JeTbbecalIKCv4eh6Kme8g7Q/ZzteD/uhhUY/36 wT3KK++OXr2V/NyxbzvfwGbPriJzFtbKIKt8KWCjm6CwpeKkyTuTFmjFXLCigg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGuXy-00016s-6m; Wed, 05 Jul 2023 00:55:22 -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 1qGuXw-00016b-3o for emacs-orgmode@gnu.org; Wed, 05 Jul 2023 00:55:20 -0400 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGuXu-0004Gk-HL for emacs-orgmode@gnu.org; Wed, 05 Jul 2023 00:55:19 -0400 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6b73b839025so5263775a34.1 for ; Tue, 04 Jul 2023 21:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688532917; x=1691124917; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=HV8Xo28AErc4ZJSjeqe9dkp8NxdMXA70IlAVatKro1g=; b=RGFXFcauKNjhomauxpm9FHetDtietVXXjD8oYZEs7OCQU66yn38Bi9cZZK1S9IhI/J jYv7/EOmdXmlRdj3DeyrrYTvVhEW46+reWIz7ipmN14nIX2v4vOMWgDXrBYypQVs1Gsf UUYZaihIIUvqcfWq+MNxVPux5nG04ssJBF3tIYCVrvu5Xwk94K02CItoMla0ZAZW4CSa dSzZdGDjn2l1DREissE84jhKetKLiM4SACp2Vfq8js5QvlrtCA7alI9+CxrAvHtcMBSk HXqkYMFP63wi3ntp1JKnwYWMuOLwZ4WcMWUo+pV1DIdE5+zWTlYj9B0O7f+wm0NIZJ6z 2/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688532917; x=1691124917; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HV8Xo28AErc4ZJSjeqe9dkp8NxdMXA70IlAVatKro1g=; b=gI0Kof/+OFDggIDlMhMuXkBFuaKCc2wIKU9B2imrpXNcIBsWk/5ESVdPvpCIXYNLoG 9vE/69vLO/ysezt+mTcMQRqGs9fzmhJ1P70+v5QPncnfkHWfG2XIY78KuIA47YmmwwlO ciiqiphkSUosxCnzKWG9BF61L6TTKWLxHatpl0D8hXmZBBoslhqT+lk9cw8koNbSyXjU 1Hn+RIx1EnB5jPQiOf3mTrLQPkY3Qm3cQabvjdtYghiaNanArHfSoPVga+zNQhRjE+1l vBVVHv44tRWUeBKs+BZ6cBHSSs8/3xMI/atOn2KlFl7+10Vnb5ey7whs+zuNPTW8zgqB i1/A== X-Gm-Message-State: ABy/qLb22IR44YD2SEAw1P6ai4A4V+TL0M7tKSRz4fT4eak0WZB0jzZV KhqNu7ohQYBooUZ3wDko5RU= X-Google-Smtp-Source: APBJJlFQOll4s/VRbaSJIwM6pdN5e+kuT7d4QmBJ7iJFJLjx8bML2YpiaRGw0tHt77fQgg4lFXXQzg== X-Received: by 2002:a05:6359:2e90:b0:134:ce45:b785 with SMTP id rp16-20020a0563592e9000b00134ce45b785mr8618821rwb.8.1688532916700; Tue, 04 Jul 2023 21:55:16 -0700 (PDT) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id je4-20020a170903264400b001b55c0548dfsm18023381plb.97.2023.07.04.21.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 21:55:15 -0700 (PDT) From: Jack Kamm To: Ihor Radchenko , Liu Hui Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] ob-python: support header argument `:results file graphics' In-Reply-To: <877crh8htb.fsf@localhost> References: <877crh8htb.fsf@localhost> Date: Tue, 04 Jul 2023 21:55:14 -0700 Message-ID: <871qhn2c0d.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=jackkamm@gmail.com; helo=mail-ot1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: B978A1BA64 X-Spam-Score: -6.43 X-TUID: a0K8tiQjADPY Ihor Radchenko writes: > Liu Hui writes: > >> This patch adds graphics output support for ob-python via matplotlib. >> Specifically, it allows to use header argument `:results file >> graphics' as follows: >> >> #+begin_src python :file "test.png" :results graphics file >> import matplotlib.pyplot as plt >> plt.plot([1,2,3,4,5]) >> #+end_src > > This might be a useful feature, but it will break the existing > conventions, if used as in the patch. Currently, the above combination > of :file and :results is treated as the following: ":results graphics file" is used this way in ob-R and ob-julia, and also in the testing files test-ob-octave.el and ob-maxima-test.org. ":results graphics" just means that the result from org-babel-execute:lang isn't written to the file by org-babel-execute-src-block. This is needed for plotting because org-babel-execute:lang usually writes directly to the file, rather than returning a byte stream for the PNG or SVG. So the Org manual's wording about "side-effects" and "output not written to disk" is correct in a sense, but also confusing (readers should not have to know about these internal implementation details).