emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Images generated by R code blocks do not display
@ 2022-11-22 21:18 William Denton
  2022-11-24  2:19 ` Ihor Radchenko
  0 siblings, 1 reply; 19+ messages in thread
From: William Denton @ 2022-11-22 21:18 UTC (permalink / raw)
  To: emacs-orgmode

I have a problem with images made by R code blocks in Org: not being displayed 
or refreshed.  (This has been going on for a while, but I can't remember when it 
started.)  Here's a minimal reproducible example I hope others can check.  It 
requires R on your system and the ESS package.

First, here's my minimal-init.el file:

#----- minimal-init.el
   (setq debug-on-error t
         debug-on-signal nil
         debug-on-quit nil)

   (add-to-list 'load-path (expand-file-name "/usr/local/src/org-mode/lisp"))

   (org-babel-do-load-languages 'org-babel-load-languages '(
        (R . t)
        (shell . t)
        ))

   (add-to-list 'load-path "~/.emacs.d/elpa/ess-20221121.1627") ;;  "/usr/local/src/ESS/lisp"
   (require 'ess-r-mode)
# -----

For me this runs Org from the source tree (up to date today) and ESS from where 
it was installed (package updated yesterday, as it happens).  Adjust paths as 
necessary.

Next, here is r.org, with one R code block that makes a simple chart:

# ----- r.org
   #+begin_src R :results graphics file :file /tmp/plot.png :width 300 :height 300
   plot(c(1, 2, 3, 4), c(1, 8, 27, 64))
   #+end_src
# -----

Run Emacs:

$ emacs -Q -l minimal-init.el

In Emacs:

+ C-x C-f (load r.org wherever it is)
+ C-c C-c (to execute the R code)
+ Say yes to "Evaluate this R code block on your system?"
+ #RESULTS block appears (good) but image does not show
+ C-c C-x C-v (to toggle image display)
+ image appears
+ C-c C-c (to execute R code again)
+ Say yes to "Evaluate this R code block on your system?"
+ image disappears
+ C-c C-x C-v says "Inline image display turned off"
+ C-c C-x C-v says "Inline image display turned off" (and so on)

Expected behaviour:  Images should appear when this code block is run or rerun, 
and C-c C-X C-v (org-toggle-inline-images) should toggle the setting, not keep 
it off.

Thanks,

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-12-12  3:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 21:18 Images generated by R code blocks do not display William Denton
2022-11-24  2:19 ` Ihor Radchenko
2022-11-24  2:46   ` William Denton
2022-11-24  2:56     ` Ihor Radchenko
2022-11-24  3:19       ` William Denton
2022-11-24  3:24         ` Ihor Radchenko
2022-11-24  3:29           ` William Denton
2022-11-24  3:43             ` Ihor Radchenko
2022-11-24  4:11               ` William Denton
2022-11-25  2:03                 ` Ihor Radchenko
2022-11-27 13:18                   ` Jeremie Juste
2022-11-27 13:21                     ` Ihor Radchenko
2022-11-27 14:16                       ` Jeremie Juste
2022-11-28 20:44                   ` William Denton
2022-11-29  4:16                     ` William Denton
2022-12-08 11:19                     ` Ihor Radchenko
2022-12-08 15:37                       ` William Denton
2022-12-10 10:04                       ` Ihor Radchenko
2022-12-12  3:10                         ` William Denton

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