Draw a gating strategy or a panel on the current device
Source:R/strategy_plot.R
print.gatelab_strategy.RdA strategy from gatelabStrategyPlot and a panel from
gatelabPanelGrob are grid drawings of a fixed size. print() and
plot() start a new page on the current graphics device and draw the figure at its
centre, so one shows when it is returned at the console.
Details
The figure keeps its own size whatever the device's, and a device smaller than the figure
cuts it off. To save a strategy at its size, open the device with the strategy's
width and height attributes (inches); a panel is plot_size * scale / 96
inches square.
Examples
set.seed(1)
panel <- gatelabPanelGrob(rnorm(2000, 3), rnorm(2000, 3), xlim = c(-1, 7), ylim = c(-1, 7),
xlab = "CD4", ylab = "CD8", title = "All Events (2,000)")
file <- tempfile(fileext = ".pdf")
grDevices::pdf(file, width = 300 / 96, height = 300 / 96)
print(panel)
grDevices::dev.off()
#> agg_record_8d47400715ff
#> 2