Skip to content

Instantly share code, notes, and snippets.

@rdesfo
Last active April 2, 2023 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdesfo/c3bcf663039428a69b9b3a82740fef2a to your computer and use it in GitHub Desktop.
Save rdesfo/c3bcf663039428a69b9b3a82740fef2a to your computer and use it in GitHub Desktop.
R plot in orgmode

Before executing

Is it possible to anchor the results output under the cpation and name or get orgmode to regenerate the caption with the ouptut? I’ve attempted to adding a :post <another source block name> with a drawer but I couldn’t get it printout in a way that would easily export.

hist(project_df$column, col="red", main="Plot title")

Followiing lines aren’t being displayed so they are being wrapped in an example block.

#+CAPTION: Plot caption
#+NAME: project.png
#+RESULTS: 

After executing

hist(project_df$column, col="red", main="Plot title")
#+RESULTS: 
<<image appears here>>

#+CAPTION: Plot caption
#+NAME: project.png

Problem

After executing again the results output gets moved above the caption and name, which means they are no longer associated with the results when exporting to odt or pdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment