Org release 9.7

Org Release 9.7 brings many new features, I’m excited about:

  • Images and files in clipboard can be pasted
  • New customization org-image-max-width
  • Asynchronous code evaluatation in ob-shell
  • org-auto-align-tags is now respected universally

Literate config folks might find this convenient

  • ob-tangle.el: New flag to remove tangle targets before writing

Many more at: Release notes | Org mode

5 Likes

One feature I’m really excited to try is this org-babel python one. Quoting from the manual:

iStarting in Org 9.7, ob-python can automatically use matplotlib to save graphics results, using the header arg :results graphics file. The
behavior depends on whether value or output results are used. For value results, the last line should return a matplotlib Figure object to plot.
For output results, the current figure (as returned by pyplot.gcf()) is cleared before evaluation, and then plotted afterwards.

Here is an example using output results:

#+begin_src python :results graphics file output :file boxplot.svg
  import matplotlib.pyplot as plt
  import seaborn as sns
  plt.figure(figsize=(5, 5))
  tips = sns.load_dataset("tips")
  sns.boxplot(x="day", y="tip", data=tips)
#+end_src

And here is the same example using value results:

#+begin_src python :results graphics file value :file boxplot2.svg
  import matplotlib.pyplot as plt
  import seaborn as sns
  plt.figure(figsize=(5, 5))
  tips = sns.load_dataset("tips")
  sns.boxplot(x="day", y="tip", data=tips)
  return plt.gcf()
#+end_src
2 Likes

Yeah this definitely brings the org-babel experience (out of the box) closer to the ease of Jupyter notebooks, which is great!

1 Like