From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id vizLDz0XRV9gOgAA0tVLHw (envelope-from ) for ; Tue, 25 Aug 2020 13:50:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id EDUPCz0XRV92GwAAbx9fmQ (envelope-from ) for ; Tue, 25 Aug 2020 13:50:53 +0000 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 9E8B59403CB for ; Tue, 25 Aug 2020 13:50:52 +0000 (UTC) Received: from localhost ([::1]:43190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAZLe-0005FY-9t for larch@yhetil.org; Tue, 25 Aug 2020 09:50:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAZKx-0005BA-IT for emacs-orgmode@gnu.org; Tue, 25 Aug 2020 09:50:07 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:46424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAZKv-0007xO-IS for emacs-orgmode@gnu.org; Tue, 25 Aug 2020 09:50:07 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 31so4614577pgy.13 for ; Tue, 25 Aug 2020 06:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=LEnxBQfva68qDA9EwTQEVFMaaQ6OVF+5UrxPoifJEx4=; b=LPsECr0ppSQebdGsJ8GXuSndbEV6du9iz6G/FLro0nx73E4n1Km2FZWCbyPpyEei7q nKQegVeG4JSYZwUgTqxTTIrzd51L9Mdf1U8sgky01oC5w/e3/Jwj+lRKY4D/KQvEzD1F i1kOiHfo5EY23hGOAMfTr7/lMkMTqQAbDlNMwSEU1hSmJ2xRJf5pFUJHxLjpJ9o7sGNB HHxFm6fC+4cIXNnpYhXU6s/Cby8siJmW9DupYY/5pdxiqC2HYZtgWsK1TCDZ2+Z1p01i faHLWvG9YvzM09sKROOv0Au2bigUvGVcTCCQLu7j2HJWbc/YdrtL25xlHDEgNyuwyGKO i+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=LEnxBQfva68qDA9EwTQEVFMaaQ6OVF+5UrxPoifJEx4=; b=IufZ6BU6PDIxAmHC5hX1ThBu6AzMDxAMz5zBliITgZ/kXFvfJ0iAawKTkKYB0CYI+p eE73M1IZNKJVZDLzhSprgRrK1BCYJy6EM8SJirYjEf/5DdN4+7Y7MtCLC8FEgj9sn6Ws 97hDWiErBi/kcwmO0DHM6KRV7Eq/O5qSifeT3zbcf8JUK80/WKa+lGERTZU+AXtWnnJd iLAIyGCO36F/kVB+3g1GdkFK/msk1k2sgvvlWh3ijdJ23g1zVo7KbPXpIrs6RVLXvRvk UeOdIpmDnMTFP4vDVWjHLtFdBuF9Efe+O9mQnkT4jV7Zh8JibpH6iK01N/6DCoFZxZGS BCNQ== X-Gm-Message-State: AOAM530Tov4iq/v647QzSAtJMIM5aItVCHUJ5Kaq8lSgxFbo24Ad1zb+ LShzVg0coJ8/IXxD/e9Yp+W3DiHWsTU= X-Google-Smtp-Source: ABdhPJx8O5o4oE8vhesrQCw0qwt31kW0ToyhXG29CwYFdMCddDEYE0qFOpJ7cUy1xnbzf2qfD7hYRg== X-Received: by 2002:a63:920e:: with SMTP id o14mr6842954pgd.367.1598363403998; Tue, 25 Aug 2020 06:50:03 -0700 (PDT) Received: from localhost (199-83-220-90.PUBLIC.monkeybrains.net. [199.83.220.90]) by smtp.gmail.com with ESMTPSA id gk19sm4394458pjb.2.2020.08.25.06.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 06:50:03 -0700 (PDT) From: Jack Kamm To: Jeremie Juste , emacs-orgmode@gnu.org Subject: Re: save plot in python babel In-Reply-To: <87imd7ue06.fsf@gmail.com> References: <87imd7ue06.fsf@gmail.com> Date: Tue, 25 Aug 2020 06:50:02 -0700 Message-ID: <87y2m2g7hx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x52a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=LPsECr0p; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: zGHVfCm0c2a5 Hi Jeremie, > I tried to look around and noticed that the documentation regarding > python with org-mode is aging a bit... Any help will be > appreciated. I'll be ready to improve the documentation of org-babel > python setup as soon as I'm more familiar with it myself. Historically ob-python has been a bit broken, especially sessions. Earlier this year, I started taking care of ob-python and implemented some fixes [1], which will land in 9.4. When that's released, I plan to update the outdated worg documentation [2]. > I've barely use python with org-mode and I would need some help with > the python setup. I somehow have some trouble saving python plots. Is > this the right way to do it? This part of the documentation [2], at the bottom of the page, is still up-to-date. Basically, you need to manually call plt.savefig(), then return the filename. > In R things seems to be smoother. Yes, ob-R is in much better shape. In addition to plotting, returning dataframes works (pandas DataFrames are not yet supported in ob-python). I also much prefer the way ob-R returns lists as a column vector instead of a row vector. > there are ob-* all over the place. [1] ob-ipython does not seem to be > maintained For serious work these days, I'm using ob-jupyter [3], which works really well. Scimax [4] also has a maintained fork of ob-ipython, though I haven't tried it. My goal is to make ob-python a serious alternative to these external ob-* packages eventually. Here are some of the improvements I have in mind: - Improved plotting - Support for pandas DataFrames and numpy Arrays - Async session evaluation [5] I've been delayed working on this as I've gotten very busy due to the pandemic (I am a bioinformaticist working on SARS-CoV-2 sequencing). But I'm hoping to make a bit of progress this week, as I'm on vacation and unable to go outside due to the smoke from the California fires. It's unclear to me if we're in a feature freeze, so I'm currently pushing ob-python development to a separate branch [6], which I'll cherry pick into master after the Org 9.4 release. [1] https://orgmode.org/list/87pnfdo88v.fsf@gmail.com/ [2] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html [3] https://github.com/nnicandro/emacs-jupyter [4] https://github.com/jkitchin/scimax [5] https://github.com/jackkamm/ob-session-async [6] https://code.orgmode.org/jackkamm/org-mode/src/python-develop