From: "Cook, Malcolm" <MEC@stowers.org>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: TIP: use svglite as device in for producing plots in R/ESS code blocks
Date: Thu, 3 Nov 2022 17:49:19 +0000 [thread overview]
Message-ID: <MN0PR20MB4666FFCF4C88CCFC35D48C43BE389@MN0PR20MB4666.namprd20.prod.outlook.com> (raw)
I wanted to use svglite as the driver for producing .svg plots within org.
It took a little poking around but the solution was one line:
```
(setf (alist-get :svg org-babel-R-graphics-devices ) '("svglite" "file"))
```
Of course it requires:
```
library(svglite)
```
...to have been called in the R session.
This greatly simplifies using org to author graphics heavy literate programming / exploratory data analyses, especially in combination with
- https://emacs.stackexchange.com/questions/29871/how-to-embed-svg-output-of-org-mode-src-block-as-inline-svg-in-html-export
- building emacs with svg support
I mention this TIP in case anyone else is similarly inclined, and in case they have additional TIPs that similarly improve working with org/ESS/R/svg
Oh, and, you can set it back with:
```
(setf (alist-get :svg org-babel-R-graphics-devices ) '("svg" "file"))
```
... and there is probably some juju to make it buffer local 😉
Cheers,
Malcolm Cook
reply other threads:[~2022-11-03 17:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
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=MN0PR20MB4666FFCF4C88CCFC35D48C43BE389@MN0PR20MB4666.namprd20.prod.outlook.com \
--to=mec@stowers.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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).