[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [babel] suggestion: wrap creation of graphics into try() block
From: |
Andreas Leha |
Subject: |
Re: [O] [babel] suggestion: wrap creation of graphics into try() block |
Date: |
Mon, 20 Jan 2014 15:00:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Rainer M Krug <address@hidden> writes:
> Hi
>
> I have two suggestions which are liked to each other. They are based
> on R code blocks, but the should be useful for other languages as well.
>
> I have a document in which I use :session for creating R graphs. These
> look like:
>
> #+begin_src R :file Correlation_1.pdf :results graphics
> IFN.mean <- load.IFN.mean()
> grid <- load.grid.CASTANEA.average()
> image(IFN.mean)
> #+end_src
>
> Everything works fine, unless there is an error in one graph.
>
> In this case, the device remains open, which leaves open devices at
> the end of the export of the document.
I experience the same problem. And would love to see that addressed.
>
> If the code block which should create the graph would be wrapped into
> a try() block, so that it would look like the following:
>
> try(
> {
> pdf("./Correlation_1.pdf")
> IFN.mean <- load.IFN.mean()
> grid <- load.grid.CASTANEA.average()
> image(IFN.mean)
> }
> )
> dev.off()
>
> The device would be closed even if an error occurred during the
> execution of the code.
>
> But still, when exporting to pdf, the call to pdflatex fails as only
> a empty pdf is available. So it becomes necessary to go through the
> pdf log to identify the graphs which failed.
>
> In this case it would be useful, to have a placeholder grah in the
> final pdf, so that one can see which graphs did not work.
>
> In addition, this could be used as placeholders (well - they are
> placeholders) for to be created graphs, while the text has already
> been written.
>
> So my second suggestion would be to include a placeholder image, which
> would be used if the generation of the actual graph fails. It would be
> great (but not necessary) if the actual error message would be in the
> image.
Such an place holder image would be great, indeed.
Thanks for bringing this up!
Regards,
Andreas
- [O] [babel] suggestion: wrap creation of graphics into try() block, Rainer M Krug, 2014/01/20
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block,
Andreas Leha <=
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Rainer M Krug, 2014/01/20
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Eric Schulte, 2014/01/20
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Rainer M Krug, 2014/01/20
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Eric Schulte, 2014/01/20
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Rainer M Krug, 2014/01/21
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Andreas Leha, 2014/01/21
- [O] :draft header argument for source block evaluation - WAS: [babel] suggestion: wrap creation of graphics into try() block, Rainer M Krug, 2014/01/21
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Eric Schulte, 2014/01/26
- Re: [O] [babel] suggestion: wrap creation of graphics into try() block, Rainer M Krug, 2014/01/27