In an org file, if I include a MATLAB src block that has a graphic output (a figure is plotted there), for example, the following src block:

#+begin_src matlab :session :file tst.png :results graphics

it won't be shown in the result of the src block (although the file gets saved as it should). Emacs returns, Code block produces no output (this is "not" the case for a python src block).


This issue is related to recent changes in org-mode (i.e. org 9.3). In the latest change log they mentioned that:

:file header argument no longer assume "file" :results The "file" :results value is now mandatory for a code block returning a link to a file. The :file or :file-ext header arguments no longer imply a "file" result is expected.

So, one needs to use the following block to have the graphic output:

#+begin_src matlab :session :file tst.png :results file graphics

for :results only graphics is not sufficient any more, it needs to be file graphics

  • Hello. This works great in typical org files; however, when I use it inside of org-msg ( to send a plot in an email) for some reason the result file directory is trailed by /../../../ such as file:../../../chart.png Do you have any idea of why this happens and a work-around?
    – Ajned
    Jul 25 '20 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.