Last data update: 2014.03.03

R: Query and set session-wide graphical parameter defaults.
flowViz.par.getR Documentation

Query and set session-wide graphical parameter defaults.

Description

flowViz.par.get is the equivalent to trellis.par.get. It queries the session wide defaults for all lattice and flowViz graphical parameters.

Usage

flowViz.par.get(name = NULL)

flowViz.par.set(name, value, ..., theme, warn = TRUE, strict = FALSE,
  reset = FALSE)

Arguments

name

The name of a parameter category to set.

value

A named list of values to set for category name or a list of such lists if name is missing.

theme

The theme to set. See trellis.par.set for details.

warn

This gets passed on directly to trellis.par.set.

strict

This gets passed on directly to trellis.par.set.

reset

logical scalar. When TRUE, drop the entire list of old graphical parameters and reset it with the supplied one. Default is FALSE, which updates the existing parameters.

...

Further arguments that get passed on.

Details

flowViz.par.set is the equivalent to trellis.par.set. It sets the same set of graphical parameters, either in the flowViz package or directly in lattice.

Getting and setting graphical parameters in flowViz follows exactly the mechanism of the lattice package. For all purpose and intentions, flowViz.par.get and flowViz.par.get can be viewed as wrappers around their lattice counterparts trellis.par.get and trellis.par.set and you should consult their documentation for further details.

We introduce four new categories of graphical parameters that are relevant for flowViz plots:

gate

Controls the appearance of gate boundaries in xyplots (if smooth=TRUE) or of the points within a gate region (smooth=FALSE). Available parameters are col, cex,pch,alpha,lwd,lty and fill.

gate.density

Controls the appearance of gate boundaries in densityplots. Available parameters are col, alpha,lwd,lty and fill.

flow.symbol

Controls the appearance of 'regular' points in a flowViz plot. Available parameters are col, cex,pch,alpha and fill.

gate.text

Controls the appearance of the text used for gate names. Available parameters are col, cex,font,alpha and lineheight.

Value

flowViz.par.get returns a list of graphical parameter defaults, if name is not empty, only for this particular category. For an empty name argument, the function returns all parameter defaults, including the ones specified in the lattice package.

flowViz.par.set is called for its side-effects of setting default parameters.

Note

Because parameter settings in lattice are device-dependent, flowViz.par.get will open a (default) device none is open at the time of the query.

Author(s)

F. Hahne

References

Deepayan Sarker, Lattice, Multivariate Data Visualization with R, Springer, New York, 2008

See Also

trellis.par.get and trellis.par.set

Examples

## Return all available parameters, including lattice ones
flowViz.par.get()

## Set the font for gate names
flowViz.par.set("gate.text", list(font=2))

## Query only the gate.text category
flowViz.par.get("gate.text")

## Set a lattice parameter
plot.symbol <- trellis.par.get("plot.symbol")
flowViz.par.set("plot.symbol", list(col="red"))
trellis.par.get("plot.symbol")

## undo all settings
flowViz.par.set(list(plot.symbol=plot.symbol, gate.text=list(font=1)))

data(GvHD)
fs <- GvHD[1:2]

# using default ggplot2like theme
densityplot(~`FSC-H`, fs)
xyplot(`SSC-H`~`FSC-H`, fs, smooth = FALSE)

# reset it with default lattice theme
flowViz.par.set(theme =  trellis.par.get(), reset = TRUE)
densityplot(~`FSC-H`, fs)
xyplot(`SSC-H`~`FSC-H`, fs, smooth = FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(flowViz)
Loading required package: flowCore
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/flowViz/flowViz.par.get.Rd_%03d_medium.png", width=480, height=480)
> ### Name: flowViz.par.get
> ### Title: Query and set session-wide graphical parameter defaults.
> ### Aliases: flowViz.par.get flowViz.par.set
> 
> ### ** Examples
> 
> ## Return all available parameters, including lattice ones
> flowViz.par.get()
$gate
$gate$alpha
[1] 1

$gate$cex
NULL

$gate$pch
NULL

$gate$col
[1] "#9E0142"

$gate$fill
[1] "transparent"

$gate$lwd
[1] 1

$gate$lty
[1] "solid"


$gate.text
$gate.text$font
[1] 1

$gate.text$col
[1] "#000000"

$gate.text$alpha
[1] 1

$gate.text$cex
[1] 0.8

$gate.text$lineheight
[1] 0.8

$gate.text$background
$gate.text$background$fill
[1] "white"

$gate.text$background$col
[1] "transparent"

$gate.text$background$alpha
[1] 1



$overlay.symbol
$overlay.symbol$alpha
[1] 0.5

$overlay.symbol$bg.alpha
[1] 0.3

$overlay.symbol$col
[1] "transparent"

$overlay.symbol$fill
[1] "red"

$overlay.symbol$cex
[1] 0.5

$overlay.symbol$pch
[1] 19


$flow.symbol
$flow.symbol$alpha
[1] 1

$flow.symbol$cex
[1] 0.1

$flow.symbol$pch
[1] 19

$flow.symbol$col
[1] "black"

$flow.symbol$fill
[1] "transparent"


$gate.density
$gate.density$alpha
[1] 1

$gate.density$fill
[1] "#FFFFFFB3"

$gate.density$col
[1] "black"

$gate.density$lwd
[1] 1

$gate.density$lty
[1] "dotted"


$argcolramp
function (n) 
{
    x <- ramp(seq.int(0, 1, length.out = n))
    rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255, alpha = alpha * 
        255)
}
<environment: 0x67b8c18>

$grid.pars
list()

$fontsize
$fontsize$text
[1] 12

$fontsize$points
[1] 8


$background
$background$alpha
[1] 1

$background$col
[1] "transparent"


$panel.background
$panel.background$col
[1] "grey90"


$clip
$clip$panel
[1] "on"

$clip$strip
[1] "on"


$add.line
$add.line$alpha
[1] 1

$add.line$col
[1] "black"

$add.line$lty
[1] 1

$add.line$lwd
[1] 1


$add.text
$add.text$alpha
[1] 1

$add.text$cex
[1] 0.8

$add.text$col
[1] "black"

$add.text$font
[1] 1

$add.text$lineheight
[1] 1.2


$plot.polygon
$plot.polygon$alpha
[1] 1

$plot.polygon$col
[1] "grey20"

$plot.polygon$border
[1] "transparent"

$plot.polygon$lty
[1] 1

$plot.polygon$lwd
[1] 1


$box.dot
$box.dot$alpha
[1] 1

$box.dot$col
[1] "grey20"

$box.dot$cex
[1] 1

$box.dot$font
[1] 1

$box.dot$pch
[1] "|"


$box.rectangle
$box.rectangle$alpha
[1] 1

$box.rectangle$col
[1] "grey20"

$box.rectangle$fill
[1] "white"

$box.rectangle$lty
[1] 1

$box.rectangle$lwd
[1] 1


$box.umbrella
$box.umbrella$alpha
[1] 1

$box.umbrella$col
[1] "grey20"

$box.umbrella$lty
[1] 1

$box.umbrella$lwd
[1] 1


$dot.line
$dot.line$alpha
[1] 1

$dot.line$col
[1] "white"

$dot.line$lty
[1] 1

$dot.line$lwd
[1] 1


$dot.symbol
$dot.symbol$alpha
[1] 1

$dot.symbol$cex
[1] 0.8

$dot.symbol$col
[1] "black"

$dot.symbol$font
[1] 1

$dot.symbol$pch
[1] 19


$plot.line
$plot.line$alpha
[1] 1

$plot.line$col
[1] "black"

$plot.line$lty
[1] 1

$plot.line$lwd
[1] 1


$plot.symbol
$plot.symbol$alpha
[1] 1

$plot.symbol$cex
[1] 0.6

$plot.symbol$col
[1] "black"

$plot.symbol$font
[1] 1

$plot.symbol$pch
[1] 19

$plot.symbol$fill
[1] "transparent"


$reference.line
$reference.line$alpha
[1] 1

$reference.line$col
[1] "white"

$reference.line$lty
[1] 1

$reference.line$lwd
[1] 1


$strip.background
$strip.background$alpha
[1] 1

$strip.background$col
[1] "grey80" "grey70" "grey60"


$strip.shingle
$strip.shingle$alpha
[1] 1

$strip.shingle$col
[1] "grey60" "grey50" "grey40"


$strip.border
$strip.border$alpha
[1] 1

$strip.border$col
[1] "transparent"

$strip.border$lty
[1] 1 1 1 1 1 1 1

$strip.border$lwd
[1] 1 1 1 1 1 1 1


$superpose.line
$superpose.line$alpha
[1] 1

$superpose.line$col
[1] "#F8766D" "#B79F00" "#00BA38" "#00BFC4" "#619CFF" "#F564E3"

$superpose.line$lty
[1] 1 1 1 1 1 1 1

$superpose.line$lwd
[1] 1 1 1 1 1 1 1


$superpose.symbol
$superpose.symbol$alpha
[1] 1 1 1 1 1 1 1

$superpose.symbol$cex
[1] 0.6

$superpose.symbol$col
[1] "#F8766D" "#B79F00" "#00BA38" "#00BFC4" "#619CFF" "#F564E3"

$superpose.symbol$fill
[1] "#CCFFFF" "#FFCCFF" "#CCFFCC" "#FFE5CC" "#CCE6FF" "#FFFFCC" "#FFCCCC"

$superpose.symbol$font
[1] 1 1 1 1 1 1 1

$superpose.symbol$pch
[1] 19


$superpose.polygon
$superpose.polygon$alpha
[1] 1 1 1 1 1 1 1

$superpose.polygon$col
[1] "#F8766D" "#B79F00" "#00BA38" "#00BFC4" "#619CFF" "#F564E3"

$superpose.polygon$border
[1] "transparent"

$superpose.polygon$lty
[1] 1 1 1 1 1 1 1

$superpose.polygon$lwd
[1] 1 1 1 1 1 1 1


$regions
$regions$alpha
[1] 1

$regions$col
  [1] "#3B4FB8" "#3C4EB6" "#3D4DB4" "#3E4DB3" "#404CB1" "#414CB0" "#424BAE"
  [8] "#434BAC" "#454AAB" "#464AA9" "#4749A8" "#4849A6" "#4A48A4" "#4B48A3"
 [15] "#4C47A1" "#4D47A0" "#4F469E" "#50469C" "#51459B" "#524599" "#544498"
 [22] "#554396" "#564394" "#574293" "#594291" "#5A4190" "#5B418E" "#5C408C"
 [29] "#5E408B" "#5F3F89" "#603F88" "#613E86" "#633E84" "#643D83" "#653D81"
 [36] "#663C80" "#683C7E" "#693B7C" "#6A3B7B" "#6B3A79" "#6D3978" "#6E3976"
 [43] "#6F3874" "#703873" "#723771" "#733770" "#74366E" "#75366C" "#77356B"
 [50] "#783569" "#793468" "#7A3466" "#7C3365" "#7D3363" "#7E3261" "#7F3260"
 [57] "#81315E" "#82315D" "#83305B" "#843059" "#862F58" "#872E56" "#882E55"
 [64] "#892D53" "#8B2D51" "#8C2C50" "#8D2C4E" "#8E2B4D" "#902B4B" "#912A49"
 [71] "#922A48" "#932946" "#952945" "#962843" "#972841" "#982740" "#9A273E"
 [78] "#9B263D" "#9C263B" "#9D2539" "#9F2438" "#A02436" "#A12335" "#A22333"
 [85] "#A42231" "#A52230" "#A6212E" "#A7212D" "#A9202B" "#AA2029" "#AB1F28"
 [92] "#AC1F26" "#AE1E25" "#AF1E23" "#B01D21" "#B11D20" "#B31C1E" "#B41C1D"
 [99] "#B51B1B" "#B71B1A"


$shade.colors
$shade.colors$alpha
[1] 1

$shade.colors$palette
function (irr, ref, height, saturation = 0.9) 
{
    hsv(h = height, s = 1 - saturation * (1 - (1 - ref)^0.5), 
        v = irr)
}
<environment: 0x67c76c8>


$axis.line
$axis.line$alpha
[1] 1

$axis.line$col
[1] "transparent"

$axis.line$lty
[1] 1

$axis.line$lwd
[1] 1


$axis.text
$axis.text$alpha
[1] 1

$axis.text$cex
[1] 0.8

$axis.text$col
[1] "grey50"

$axis.text$font
[1] 1

$axis.text$lineheight
[1] 0.9


$axis.components
$axis.components$left
$axis.components$left$tck
[1] 1

$axis.components$left$pad1
[1] 1

$axis.components$left$pad2
[1] 1


$axis.components$top
$axis.components$top$tck
[1] 1

$axis.components$top$pad1
[1] 1

$axis.components$top$pad2
[1] 1


$axis.components$right
$axis.components$right$tck
[1] 1

$axis.components$right$pad1
[1] 1

$axis.components$right$pad2
[1] 1


$axis.components$bottom
$axis.components$bottom$tck
[1] 1

$axis.components$bottom$pad1
[1] 1

$axis.components$bottom$pad2
[1] 1



$layout.heights
$layout.heights$top.padding
[1] 1

$layout.heights$main
[1] 1

$layout.heights$main.key.padding
[1] 1

$layout.heights$key.top
[1] 1

$layout.heights$xlab.top
[1] 1

$layout.heights$key.axis.padding
[1] 1

$layout.heights$axis.top
[1] 1

$layout.heights$strip
[1] 1

$layout.heights$panel
[1] 1

$layout.heights$axis.panel
[1] 1

$layout.heights$between
[1] 1

$layout.heights$axis.bottom
[1] 1

$layout.heights$axis.xlab.padding
[1] 1

$layout.heights$xlab
[1] 1

$layout.heights$xlab.key.padding
[1] 0

$layout.heights$key.bottom
[1] 1

$layout.heights$key.sub.padding
[1] 1

$layout.heights$sub
[1] 1

$layout.heights$bottom.padding
[1] 1


$layout.widths
$layout.widths$left.padding
[1] 1

$layout.widths$key.left
[1] 1

$layout.widths$key.ylab.padding
[1] 0

$layout.widths$ylab
[1] 1

$layout.widths$ylab.axis.padding
[1] 1

$layout.widths$axis.left
[1] 1

$layout.widths$axis.panel
[1] 1

$layout.widths$strip.left
[1] 1

$layout.widths$panel
[1] 1

$layout.widths$between
[1] 1

$layout.widths$axis.right
[1] 1

$layout.widths$axis.key.padding
[1] 1

$layout.widths$ylab.right
[1] 1

$layout.widths$key.right
[1] 1

$layout.widths$right.padding
[1] 1


$box.3d
$box.3d$alpha
[1] 1

$box.3d$col
[1] "black"

$box.3d$lty
[1] 1

$box.3d$lwd
[1] 1


$par.xlab.text
$par.xlab.text$alpha
[1] 1

$par.xlab.text$cex
[1] 1

$par.xlab.text$col
[1] "black"

$par.xlab.text$font
[1] 1

$par.xlab.text$lineheight
[1] 1


$par.ylab.text
$par.ylab.text$alpha
[1] 1

$par.ylab.text$cex
[1] 1

$par.ylab.text$col
[1] "black"

$par.ylab.text$font
[1] 1

$par.ylab.text$lineheight
[1] 1


$par.zlab.text
$par.zlab.text$alpha
[1] 1

$par.zlab.text$cex
[1] 1

$par.zlab.text$col
[1] "black"

$par.zlab.text$font
[1] 1

$par.zlab.text$lineheight
[1] 1


$par.main.text
$par.main.text$alpha
[1] 1

$par.main.text$cex
[1] 1.2

$par.main.text$col
[1] "black"

$par.main.text$font
[1] 2

$par.main.text$lineheight
[1] 1


$par.sub.text
$par.sub.text$alpha
[1] 1

$par.sub.text$cex
[1] 1

$par.sub.text$col
[1] "black"

$par.sub.text$font
[1] 2

$par.sub.text$lineheight
[1] 1


> 
> ## Set the font for gate names
> flowViz.par.set("gate.text", list(font=2))
> 
> ## Query only the gate.text category
> flowViz.par.get("gate.text")
$font
[1] 2

$col
[1] "#000000"

$alpha
[1] 1

$cex
[1] 0.8

$lineheight
[1] 0.8

$background
$background$fill
[1] "white"

$background$col
[1] "transparent"

$background$alpha
[1] 1


> 
> ## Set a lattice parameter
> plot.symbol <- trellis.par.get("plot.symbol")
> flowViz.par.set("plot.symbol", list(col="red"))
> trellis.par.get("plot.symbol")
$alpha
[1] 1

$cex
[1] 0.8

$col
[1] "#0080ff"

$font
[1] 1

$pch
[1] 1

$fill
[1] "transparent"

> 
> ## undo all settings
> flowViz.par.set(list(plot.symbol=plot.symbol, gate.text=list(font=1)))
> 
> data(GvHD)
> fs <- GvHD[1:2]
> 
> # using default ggplot2like theme
> densityplot(~`FSC-H`, fs)
> xyplot(`SSC-H`~`FSC-H`, fs, smooth = FALSE)
> 
> # reset it with default lattice theme
> flowViz.par.set(theme =  trellis.par.get(), reset = TRUE)
> densityplot(~`FSC-H`, fs)
> xyplot(`SSC-H`~`FSC-H`, fs, smooth = FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>