[BlindRUG] [Good tTip]: More Accessible R Plot Device
JooYoung Seo
jooyoung at psu.edu
Fri Jun 18 03:10:56 UTC 2021
Hello,
I am writing this to share one of my tips with the list.
For many reasons, I have replaced the default plot with `httpgd` which
is rendered as an accessible SVG in your default web browser [fully
tested with console-based environments, Emacs, VSCode].
# 1. Install httpgd.
if(!require(httpgd)) {
install.packages("httpgd")
}
# 2. Open your .Rprofile
if(!require(usethis)) {
install.packages("usethis")
usethis::edit_r_profile()
# 3. Add the following line at the end of your .Rprofile and save it.
options(device = function(...) {httpgd::hgd(silent = TRUE);
httpgd::hgd_browse()})
# 4. Restart your R.
# 5. Test whether the following is plotted in your browser in an SVG form.
hist(airquality$Ozone, col = "blue")
boxplot(cars$speed, col = "lightgreen")
# Keyboard shortcuts.
## The following includes some keystrokes you can use in the httpgd
device in your browser.
## Screen reader users have to turn off virtual cursor (AKA, browse
mode / QuickNav).
* Navigate plot history: left-/right-arrows
* Zoom in and out: + / -
* Reset zoom level: 0
* Jump to the newest plot: N
* Delete plot: del / D
* Clear all plots: alt+D
* Download plot as SVG: S
* Download plot as PNG: P
* Copy plot to clipboard (as PNG): C
* Toggle plot history (sidebar): H
Hope this helps.
Best,
JooYoung
--
--------------------
JooYoung Seo, Ph.D.
RStudio's Trusted Data-Science Instructor
Learning, Design, and Technology
Learning and Performance Systems
The Pennsylvania State University
Site: https://jooyoungseo.com/
Phone: +1 (814) 777-5825
E-mail: jzs323 at psu.edu
More information about the BlindRUG
mailing list