Sorry, I just sent you the reply that was meant for Berry's advice :-). Your suggestion also looks very useful, but somehow the png files do not get saved (in the current directory or elsewhere), and I actually do not get any error messages in the R buffer (I also tried to change the file type to jpeg). Any idea why? thanks again giuseppe On Wed, Jun 5, 2024 at 8:35 PM Ihor Radchenko wrote: > Giuseppe Pagnoni writes: > > > #+begin_src R :file example.png :results output graphics file > > x <- rnorm(100) > > print(mean(x)) > > hist(x) > > hist(x^2) > > #+end_src > > > > Here, only the last plot gets displayed. Is it not possible to display > > more than 1 plot? > > We currently do not have automatic way to do it, so that the resulting > plots are inserted as previewable file links. However, in addition to > the approach with several :session source blocks proposed by Berry, you > can do it by hand in R: > > #+begin_src R :results output raw drawer :dir ./ > x <- rnorm(100) > print(mean(x)) > png(file="hist1.png") > hist(x) > png(file="hist2.png") > hist(x^2) > print("[[./hist1.png]]") > print("[[./hist2.png]]") > #+end_src > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > -- Giuseppe Pagnoni Dip. Scienze Biomediche, Metaboliche e Neuroscienze Sezione Fisiologia e Neuroscienze Univ. di Modena e Reggio Emilia Via Campi 287 I-41125 Modena, Italy Tel: +39-059-205-5742 Fax: +39-059-205-5363