blob: 40b26b3abc43f64d0abf2df5cb27ced1961d7313 [file] [log] [blame]
#=============================================================================#
# Copyright (c) 2018, 2021 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================#
## RJ graphics
.rj.initGD <- function(default= TRUE, ...) {
if (TRUE) {
warning("The graphics device for RJ is not available.");
return (FALSE);
}
if (default) {
options(device=rj::rj.GD);
}
return (TRUE);
}
rj.GD <- function(name= "rj.gd", width= 7, height= 7, size.unit= "in",
xpinch= NA, ypinch= NA, canvas= "white",
pointsize= 12, gamma= 1.0) {
stop("Unsupported operation: rj.GD");
}
#' Copies an R graphic from specified device to a new device.
gr.copyGraphic <- function(devNr= dev.cur(), device= pdf, ...) {
prevDevNr <- dev.cur();
on.exit(dev.set(prevDevNr));
dev.set(devNr);
din <- par("din");
dev.copy(device, width= din[1], height= din[2], ...);
dev.off();
invisible(devNr);
}