On 24 November 2022, Ihor Radchenko wrote:

The image should appear immediately in the buffer, shouldn't it?

No, it should not.
Though it is often requested.

Huh, strange. It's always done it for me, at least with R code blocks, as far as I can remember. But back to my original problem!

Here's another angle on it, with images not being refreshed even though they've changed.

Setup:  my minimal-init.el from my first email.

File, 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

# -----

Steps:

+ C-x C-f (load r.org)
+ C-c C-c (execute R block)
+ answer yes to "Evaluate this?" question
+ #RESULTS appears, but image doesn't show
+ C-c C-x C-v (to see image)
+ look at /tmp/plot.png: it is 300 x 300
+ edit width and height settings so they are each 500 pixels
+ C-c C-c (execute R block again)
+ answer yes to "Evaluate this?" question
+ image disappears
+ C-c C-x C-v (to see image)
+ image is still 300 pixels square! + look at /tmp/plot.png: it is 500 x 500
+ C-x C-s (save file r.org)
+ quit and restart Emacs with minimal init
+ C-x C-f (load r.org)
+ C-c C-x C-v (to see image)
+ image is 500 x 500!

So R is generating a new, larger image, and it's there on disk, but Emacs won't show it.

Thanks again,

Bill

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

Reply via email to