From c53385cee11e938b38cef41b3e01bfdb4b0d0a4a Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Sun, 19 Aug 2018 13:07:48 +0200 Subject: [PATCH] Corrected template for graphics from Python --- module2/ressources/rr_org/init.el | 2 +- module2/ressources/rr_org/init.org | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module2/ressources/rr_org/init.el b/module2/ressources/rr_org/init.el index 4e8308c..e833e54 100644 --- a/module2/ressources/rr_org/init.el +++ b/module2/ressources/rr_org/init.el @@ -178,7 +178,7 @@ Entered on %U '("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "\n\n")) (add-to-list 'org-structure-template-alist - '("PP" "#+begin_src python :results output file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nprint(matplot_lib_filename)\n#+end_src" "\n\n")) + '("PP" "#+begin_src python :results file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nmatplot_lib_filename\n#+end_src" "\n\n")) (add-to-list 'org-structure-template-alist '("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "\n\n")) diff --git a/module2/ressources/rr_org/init.org b/module2/ressources/rr_org/init.org index a0d4028..539f238 100644 --- a/module2/ressources/rr_org/init.org +++ b/module2/ressources/rr_org/init.org @@ -334,7 +334,7 @@ To use this type

\n\n")) + '("PP" "#+begin_src python :results file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nmatplot_lib_filename\n#+end_src" "\n\n")) #+end_src *** Bash "sh" code: To use this type