emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: matlab+kernel+jupyter+python: works nicely save the plot command
Date: Wed, 24 Nov 2021 14:23:42 +0100	[thread overview]
Message-ID: <87bl29wuu9.fsf@mat.ucm.es> (raw)


Hi

Using Ubuntu, python 3.5 matlab 2019a and the python matlab kernel
mathworks provides (and ob-ipython, but I presume that 
scimax (https://github.com/jkitchin/scimax) 
and https://github.com/nnicandro/emacs-jupyter would behave similar.

After starting the python-matlab engine I do

#+BEGIN_SRC emacs-lisp
(setq org-confirm-babel-evaluate nil)  
;;; display/update images in the buffer after I evaluate
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
    
(add-to-list 'org-src-lang-modes '("matlab" . matlab))
(setq python-shell-interpreter "python3")
;; set default headers for convenience
(setq org-babel-default-header-args:matlab
      '((:results . "output replace")
	(:session . "matlab")
	(:kernel . "matlab")
	(:exports . "code")
	(:cache .   "no")
	(:noweb . "no")
	(:hlines . "no")
	(:tangle . "no")))
(defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
(defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython)
(defalias 'org-babel-matlab-initiate-session 'org-babel-ipython-initiate-session)
#+END_SRC


#+begin_src matlab :results output latex :exports code  :eval never-export :wrap latex
clear all
close all
t=[0:0.1:1];
y=sin(t);
plot(t,y)
print -dpng  simple.png 
#+end_src

The print command succeeds the simple.png file is generated, however I
cannot see the figure with the plot, it never pops up.

What is wrong in my setting?

Regards

Uwe Brauer 



                 reply	other threads:[~2021-11-24 13:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl29wuu9.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).