emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* matlab+kernel+jupyter+python: works nicely save the plot command
@ 2021-11-24 13:23 Uwe Brauer
  0 siblings, 0 replies; only message in thread
From: Uwe Brauer @ 2021-11-24 13:23 UTC (permalink / raw)
  To: emacs-orgmode


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 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-24 13:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 13:23 matlab+kernel+jupyter+python: works nicely save the plot command Uwe Brauer

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).