emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: William Denton <wtd@pobox.com>
To: emacs-orgmode@gnu.org
Subject: Images generated by R code blocks do not display
Date: Tue, 22 Nov 2022 16:18:18 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2211221559080.61289@shell3.miskatonic.org> (raw)

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 

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

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.



William Denton
Librarian, artist and licensed private investigator.
Toronto, Canada

             reply	other threads:[~2022-11-22 21:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 21:18 William Denton [this message]
2022-11-24  2:19 ` Images generated by R code blocks do not display 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

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:

  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=alpine.DEB.2.22.394.2211221559080.61289@shell3.miskatonic.org \
    --to=wtd@pobox.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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