-
Notifications
You must be signed in to change notification settings - Fork 298
Closed
Description
…or deprecate and hide it from the docs.
R has a notion of the “default graphics device”, i.e. getOption('device'), which is either a string containing a function name or a function.
we could leverage this in two ways:
-
use it with custom options:
dev <- getOption('device') if (!is.function(dev)) { dev <- get(dev) } do.call(dev, as.list(options('jupyter.plot')))
-
require the user to override the defaults by setting it to a function:
#our initialization options(device = function(file.name, width = 7, height = 7,...) { png(file.name, width = width, height = height, ...) }) … dev <- getOption('device') if (!is.function(dev)) { dev <- get(dev) } dev()
the only problem: we want to allow different mime types (PNG, JPG, SVG) for plots: if it’s a function, we can’t derive the type from the option.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels