Display ESS/R plots in a dedicated Emacs window
Add the "ess-plot" folder to your load-path
.
Add the following to your init.el
(use-package ess-plot
:straight (ess-plot :recipe (:host github :repo "DennieTeMolder/ess-plot"))
:defer t)
Add the following to your package.el
:
(package! ess-plot
:recipe (:host github :repo "DennieTeMolder/ess-plot"))
And add the following to your config.el
(use-package! ess-plot :defer t)
Call M-x ess-plot-toggle
to start redirecting plots.
Gg-plots should be redirected automatically, base-R plots require calling
dev.flush()
to push the plot to the window. If the plot window was closed
call M-x ess-plot-show
to redisplay the last plot. Plots are displayed in
PNG format thus plot history can be navigated using image-mode
bindings
(i.e. image-previous-file
).
- After reloading the process the user needs to call
ess-plot-toggle
twice to restore functionality - Only implemented for the R dialect (help is welcome for others)
- Can only be active for one process at a time
- httpgd (R package) &
xwidget-webkit-browse-url
: This does provide a more RStudio like experience, allowing the user to zoom and export plots. However, in contrast to ESS-plot, this combination requires Emacs to be compiled with xwidget support and forces the user to install additional packages into their environment.