Title: | Lots of Superior Depictions |
---|---|
Description: | Create lots of colorful plots in a plethora of variations. Try the LSD demotour(). |
Authors: | Bjoern Schwalb [aut, cre], Achim Tresch [aut], Phillipp Torkler [ctb], Sebastian Duemcke [ctb], Carina Demel [ctb], Brian Ripley [ctb], Bill Venables [ctb] |
Maintainer: | Bjoern Schwalb <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 4.1-0 |
Built: | 2024-10-29 06:44:13 UTC |
Source: | CRAN |
Depict any matrix or list in a color encoded rectangular fashion.
align( input, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, label = FALSE, digits = 1, border = NULL, xlim = NULL, ylim = NULL, main = NULL, axes = TRUE, ... )
align( input, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, label = FALSE, digits = 1, border = NULL, xlim = NULL, ylim = NULL, main = NULL, axes = TRUE, ... )
input |
matrix or list with any type of entries. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
label |
logical: if |
digits |
integer indicating the number of decimals to be used for binning of continuous data. |
border |
color for rectangle border(s). Use border = NA to omit borders. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
main |
title of the plot, standard graphics parameter. |
axes |
logical: if |
... |
additional parameters to be passed to points and plot. |
Phillipp Torkler, Bjoern Schwalb
clusterplot
, demotour
, disco
, colorpalette
data(seqs) colpal = c("A" = "darkgreen","C" = "darkblue","G" = "yellow","T" = "darkred") align(seqs,colpal = colpal,label = TRUE,main = "DNA sequences") data(homer) colpal = c("white","black","yellow","wheat3") align(homer,colpal = colpal,main = "D'OH!",asp = 1,axes = FALSE)
data(seqs) colpal = c("A" = "darkgreen","C" = "darkblue","G" = "yellow","T" = "darkred") align(seqs,colpal = colpal,label = TRUE,main = "DNA sequences") data(homer) colpal = c("white","black","yellow","wheat3") align(homer,colpal = colpal,main = "D'OH!",asp = 1,axes = FALSE)
Depict a numeric matrix or list utilizing the underlying distribution quantiles of one dimension in a color encoded fashion.
clusterplot( input, label = NULL, at = NULL, main = NULL, xlim = NULL, ylim = NULL, xlabels = NULL, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "lightgrey", quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE, separate = TRUE, rev = FALSE, size = TRUE, alpha = NULL, axes = TRUE, ... )
clusterplot( input, label = NULL, at = NULL, main = NULL, xlim = NULL, ylim = NULL, xlabels = NULL, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "lightgrey", quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE, separate = TRUE, rev = FALSE, size = TRUE, alpha = NULL, axes = TRUE, ... )
input |
matrix or list with numerical entries. |
label |
a character vector assigning rows/elements of 'input' to clusters (if specified, multiple clusters can be depicted in different colors and/or subsequent plots). |
at |
a integer vector containing the x-positions corresponding to the columns of 'input'. |
main |
title(s) of the plot, standard graphics parameter. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
xlabels |
a character vector containing labels for the x-axis. |
fromto |
a numeric vector containing the range of quantiles (between 0 and 1) to be plotted. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 25, if not specified). |
outer.col |
R built-in color to be used for outlier lines (lines outside of 'fromto'). |
quartiles.col |
a character vector containing three R built-in colors for quartile lines (c('0.25','0.5','0.75')). |
add.quartiles |
logical: if |
separate |
if |
rev |
logical: if |
size |
logical: if |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
axes |
logical: if |
... |
additional parameters to be passed to points and plot. |
Achim Tresch, Bjoern Schwalb
singleclusterplot
, align
, demotour
, disco
, colorpalette
samples = 100 probes = 75 at = 1:probes clus = matrix(rnorm(probes*samples,sd=1),ncol=probes) clus = rbind( t(t(clus)+sin(1:probes/10))+1:nrow(clus)/samples, t(t(clus)+sin(pi/2+1:probes/10))+1:nrow(clus)/samples) quartiles.col = c("transparent","black","transparent") colpal = c("standardheat","crazyblue","crazyred","crazygreen") labs = paste("cluster",kmeans(clus,4)$cluster) clusterplot(clus,fromto=c(0,1)) clusterplot(clus,labs,separate=FALSE,xaxt="n",fromto=c(0.4,0.6),colpal=colpal, outer.col="none",ylim=c(-2,3),quartiles.col = quartiles.col) clusterplot(clus,labs,colpal=colpal) labs = paste("cluster",kmeans(clus,2)$cluster) colpal = c("greens","purples") clusterplot(clus,labs,separate=FALSE,xaxt="n",fromto=c(0.3,0.7),colpal=colpal, outer.col="none",ylim=c(-1,2),alpha=50,quartiles.col = quartiles.col)
samples = 100 probes = 75 at = 1:probes clus = matrix(rnorm(probes*samples,sd=1),ncol=probes) clus = rbind( t(t(clus)+sin(1:probes/10))+1:nrow(clus)/samples, t(t(clus)+sin(pi/2+1:probes/10))+1:nrow(clus)/samples) quartiles.col = c("transparent","black","transparent") colpal = c("standardheat","crazyblue","crazyred","crazygreen") labs = paste("cluster",kmeans(clus,4)$cluster) clusterplot(clus,fromto=c(0,1)) clusterplot(clus,labs,separate=FALSE,xaxt="n",fromto=c(0.4,0.6),colpal=colpal, outer.col="none",ylim=c(-2,3),quartiles.col = quartiles.col) clusterplot(clus,labs,colpal=colpal) labs = paste("cluster",kmeans(clus,2)$cluster) colpal = c("greens","purples") clusterplot(clus,labs,separate=FALSE,xaxt="n",fromto=c(0.3,0.7),colpal=colpal, outer.col="none",ylim=c(-1,2),alpha=50,quartiles.col = quartiles.col)
Provides pre-designed colorpalettes (character vectors containing R built-in colors) of this and several other R packages (grDevices, RColorBrewer, colorRamps) as well as custom-made ones.
colorpalette( colpal, nrcol = NULL, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE )
colorpalette( colpal, nrcol = NULL, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE )
colpal |
a character vector containing R built-in color names or a name of a |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to length of |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
rev |
logical: if |
colorpalette
returns a vector containing R built-in colors in hexadecimal representation.
Achim Tresch, Bjoern Schwalb
colorpalette("heat") colorpalette(c("darkred","grey","darkblue"),10)
colorpalette("heat") colorpalette(c("darkred","grey","darkblue"),10)
A function to compare two vectors extensively.
comparisonplot( x, y, histbreaks = 30, adjust = 1, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, main = "comparisonplot", cor = FALSE, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ab = FALSE, add.density = FALSE, col.density = "darkred", pimp = FALSE, ... )
comparisonplot( x, y, histbreaks = 30, adjust = 1, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, main = "comparisonplot", cor = FALSE, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ab = FALSE, add.density = FALSE, col.density = "darkred", pimp = FALSE, ... )
x |
a numeric vector. |
y |
a numeric vector. |
histbreaks |
a non-negative integer specifying the number of breaks of the histograms. |
adjust |
scale the used bandwidth of the density estimate, if |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
rev |
logical: if |
main |
title(s) of the plot, standard graphics parameter. |
cor |
if |
xlab |
x label, standard graphics parameter. |
ylab |
y label, standard graphics parameter. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
ab |
if |
add.density |
if |
col.density |
R built-in color to specify the color of the density line. |
pimp |
if |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
align
, demotour
, disco
, colorpalette
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) y = x + rnorm(points,sd=0.8) x = sign(x)*abs(x)^1.3 comparisonplot(x,y,histbreaks=30,pch=20)
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) y = x + rnorm(points,sd=0.8) x = sign(x)*abs(x)^1.3 comparisonplot(x,y,histbreaks=30,pch=20)
Convert R built-in colors to their color complement
complementarycolor(cols, alpha = NULL)
complementarycolor(cols, alpha = NULL)
cols |
a character vector containing R built-in colors. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
complementarycolor
returns a vector containing R built-in colors in hexadecimal representation.
Bjoern Schwalb
complementarycolor(c("red","green","blue"))
complementarycolor(c("red","green","blue"))
Convert R built-in colors to hexadecimal representation.
convertcolor(cols, alpha = NULL)
convertcolor(cols, alpha = NULL)
cols |
a character vector containing R built-in colors. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
convertcolor
returns a vector containing R built-in colors in hexadecimal representation.
Bjoern Schwalb
convertcolor(c("red","green","blue"))
convertcolor(c("red","green","blue"))
Greyscale R built-in colors.
convertgrey(cols, alpha = NULL)
convertgrey(cols, alpha = NULL)
cols |
a character vector containing R built-in colors. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
convertgrey
returns a vector containing R built-in colors in hexadecimal representation.
Bjoern Schwalb
convertgrey(c("red","green","blue"))
convertgrey(c("red","green","blue"))
Dichromat vision simulation and enhancement according to http://www.daltonize.org.
daltonize(colpal, cvd = "p", show = TRUE)
daltonize(colpal, cvd = "p", show = TRUE)
colpal |
a character vector containing R built-in color names or a name of a |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
show |
logical: if |
daltonize
returns a list, where each entry is a vector containing R built-in colors in hexadecimal representation:
simulated |
vector of simulated colors |
enhanced |
vector of enhanced colors |
Bjoern Schwalb
daltonize("heat",cvd = "d") daltonize("colorblind",cvd = "p")
daltonize("heat",cvd = "d") daltonize("colorblind",cvd = "p")
A compilation of selected plot examples.
demotour()
demotour()
Bjoern Schwalb
heatscatter
, clusterplot
, disco
, colorpalette
, daltonize
demotour()
demotour()
Add a color stripe to an existing plot based on a kernel density estimate.
densitylane( x, y, pos = 1, width = 0.4, colpal = "standard", rev = FALSE, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, horizontal = horizontal, nrcol = 75 )
densitylane( x, y, pos = 1, width = 0.4, colpal = "standard", rev = FALSE, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, horizontal = horizontal, nrcol = 75 )
x |
density$x values of a density object. |
y |
density$y values of a density object. |
pos |
the x co-ordinate of the lane (mid point). |
width |
a numeric value giving the width of the lane. |
colpal |
a character vector containing R built-in color names or a name of a |
rev |
logical: if |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
horizontal |
logical: if |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
Displays pre-designed colorpalettes as well as custom-made ones (see colorpalette
).
disco(colpal = NULL, nrcol = NULL, alpha = NULL)
disco(colpal = NULL, nrcol = NULL, alpha = NULL)
colpal |
a character vector containing R built-in color names or a name of a |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to length of |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
Bjoern Schwalb
disco() disco("rdbu",10)
disco() disco("rdbu",10)
Find a vector of distinct R built-in colors for a pre-defined length ('nrcol').
distinctcolors( nrcol = 10, method = "RGB", bw = FALSE, show = TRUE, simulate = TRUE )
distinctcolors( nrcol = 10, method = "RGB", bw = FALSE, show = TRUE, simulate = TRUE )
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to the length of |
method |
character string implying the method for color selection to be used ("RGB" uses a grid in the RGB space (default), "Lab" uses a grid in the Lab space, "goldenratio" uses the golden ratio as spacing between colors in the HSV color space). |
bw |
logical: if |
show |
logical: if |
simulate |
logical: if |
distinctcolors
returns a vector containing R built-in colors in hexadecimal representation.
Bjoern Schwalb
distinctcolors()
distinctcolors()
A scatterplot with additional colored ellipses based on a gaussianity assumption.
ellipsescatter( x, y, groups, colors = NULL, pch = 20, bgcol = "darkgrey", main = "ellipsescatter", xlab = NULL, ylab = NULL, scalesd = 1, level = 0.75, legend.cex = 1, location = "topright", ... )
ellipsescatter( x, y, groups, colors = NULL, pch = 20, bgcol = "darkgrey", main = "ellipsescatter", xlab = NULL, ylab = NULL, scalesd = 1, level = 0.75, legend.cex = 1, location = "topright", ... )
x |
a numeric vector. |
y |
a numeric vector. |
groups |
a list of indices or vector names to be plotted as groups (not necessarily all of x and y). |
colors |
a character vector of R build-in colors corresponding to the chosen groups. |
pch |
the plotting character (to be passed to plot). |
bgcol |
a R build-in color for non-grouped points. |
main |
title(s) of the plot, standard graphics parameter. |
xlab |
x label, standard graphics parameter. |
ylab |
y label, standard graphics parameter. |
scalesd |
a numeric value giving the scaling factor for standard deviations in each dimension (defaults to 1). |
level |
a numeric value (between 0 and 1) giving the confidence level of a pairwise confidence region. |
legend.cex |
a numerical value giving the amount by which the added legend should be magnified relative to the default. |
location |
the x and y co-ordinates to be used to position the legend (see 'xy.coords'). |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
x = c(rnorm(50),rnorm(100,2),rnorm(50,4)) y = (x + rnorm(200,0,0.8))*rep(c(1,4,1),c(50,100,50)) x = sign(x)*abs(x)^1.3 groups = list("Green" = 1:50,"Red" = 51:150,"Blue" = 151:200) colors = c("darkgreen","darkred","darkblue") ellipsescatter(x,y,groups,colors,location = "topleft")
x = c(rnorm(50),rnorm(100,2),rnorm(50,4)) y = (x + rnorm(200,0,0.8))*rep(c(1,4,1),c(50,100,50)) x = sign(x)*abs(x)^1.3 groups = list("Green" = 1:50,"Red" = 51:150,"Blue" = 151:200) colors = c("darkgreen","darkred","darkblue") ellipsescatter(x,y,groups,colors,location = "topleft")
Calls an empty graphics device with a coordinate system of choice.
emptyplot(xlim = c(-1, 1), ylim = c(-1, 1), ...)
emptyplot(xlim = c(-1, 1), ylim = c(-1, 1), ...)
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
emptyplot()
emptyplot()
Depict a numeric matrix or list utilizing the underlying distribution quantiles of one dimension in a color encoded fashion.
fusionplot( x, y, label = NULL, main = NULL, xlim = NULL, ylim = NULL, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "lightgrey", quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE, separate = TRUE, rev = FALSE, size = TRUE, alpha = NULL, axes = TRUE, ... )
fusionplot( x, y, label = NULL, main = NULL, xlim = NULL, ylim = NULL, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "lightgrey", quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE, separate = TRUE, rev = FALSE, size = TRUE, alpha = NULL, axes = TRUE, ... )
x |
a numeric vector. |
y |
a numeric vector. |
label |
a character vector assigning rows/elements of 'input' to clusters (if specified, multiple clusters can be depicted in different colors and/or subsequent plots). |
main |
title(s) of the plot, standard graphics parameter. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
fromto |
a numeric vector containing the range of quantiles (between 0 and 1) to be plotted. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 25, if not specified). |
outer.col |
R built-in color to be used for outlier lines (lines outside of 'fromto'). |
quartiles.col |
a character vector containing three R built-in colors for quartile lines (c('0.25','0.5','0.75')). |
add.quartiles |
logical: if |
separate |
if |
rev |
logical: if |
size |
logical: if |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
axes |
logical: if |
... |
additional parameters to be passed to points and plot. |
Achim Tresch, Bjoern Schwalb
singlefusionplot
, align
, demotour
, disco
, colorpalette
nr = 750 x = 1:nr/300 y = c(rnorm(nr)+sin(2*x)*3,rnorm(nr)+sin(2*x+pi/2)*3) x = c(x,x) labs = paste("cluster",c(rep(c(1,2),each = nr))) colpals = c("oranges","pubu") qcol = c("transparent","black","transparent") fusionplot(x,y,labs,separate=FALSE,colpal=colpals,alpha=75,quartiles.col = qcol)
nr = 750 x = 1:nr/300 y = c(rnorm(nr)+sin(2*x)*3,rnorm(nr)+sin(2*x+pi/2)*3) x = c(x,x) labs = paste("cluster",c(rep(c(1,2),each = nr))) colpals = c("oranges","pubu") qcol = c("transparent","black","transparent") fusionplot(x,y,labs,separate=FALSE,colpal=colpals,alpha=75,quartiles.col = qcol)
Depict a histogram object as a barplot in a color encoded fashion based on a kernel density estimate.
heatbarplot( x, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, horizontal = FALSE, nrcol = 100, ... )
heatbarplot( x, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, horizontal = FALSE, nrcol = 100, ... )
x |
a histogram object. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
rev |
logical: if |
horizontal |
logical: if |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) x = sign(x)*abs(x)^1.3 xhist = hist(x,plot = FALSE) heatbarplot(xhist)
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) x = sign(x)*abs(x)^1.3 xhist = hist(x,plot = FALSE) heatbarplot(xhist)
A boxplot with an additional color stripe based on a kernel density estimate.
heatboxplot( x, horizontal = FALSE, add = FALSE, colpal = "standard", rev = FALSE, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, colpals = NULL, nrcol = 75, lwd = 1.75, axes = TRUE, labels = NULL, xlim = NULL, ylim = NULL, xlab = NULL, ylab = "", main = "heatboxplot", nolab = FALSE, outline = TRUE, boxonly = FALSE, adjust = 1, quant.from = 0.25, quant.to = 0.75, range = 1.5, border = "black", plot.boxplot = TRUE, add.quartiles = TRUE, add.box = FALSE, n.density = 1024, cexbox = 0.6, ... )
heatboxplot( x, horizontal = FALSE, add = FALSE, colpal = "standard", rev = FALSE, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, colpals = NULL, nrcol = 75, lwd = 1.75, axes = TRUE, labels = NULL, xlim = NULL, ylim = NULL, xlab = NULL, ylab = "", main = "heatboxplot", nolab = FALSE, outline = TRUE, boxonly = FALSE, adjust = 1, quant.from = 0.25, quant.to = 0.75, range = 1.5, border = "black", plot.boxplot = TRUE, add.quartiles = TRUE, add.box = FALSE, n.density = 1024, cexbox = 0.6, ... )
x |
data as vector, matrix, list or data.frame. |
horizontal |
logical: if |
add |
logical: if |
colpal |
a character vector containing R built-in color names or a name of a |
rev |
logical: if |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
colpals |
a character vector containing names of |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
lwd |
linewidth of the box and whiskers. |
axes |
logical: if |
labels |
a character vector of labels. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
xlab |
x label, standard graphics parameter. |
ylab |
y label, standard graphics parameter. |
main |
title(s) of the plot, standard graphics parameter. |
nolab |
logical: if |
outline |
logical: if |
boxonly |
logical: if |
adjust |
a numeric value giving the scaling factor for the used bandwidth (defaults to 1). |
quant.from |
a numeric value (between 0 and 1) giving the quantile from which the density lane should be plotted. |
quant.to |
a numeric value (between 0 and 1) giving the quantile to which the density lane should be plotted. |
range |
a numeric value to determine how far the plot whiskers extend out from the box. |
border |
an R build-in color for the box and whiskers. |
plot.boxplot |
logical: if |
add.quartiles |
if |
add.box |
logical: if |
n.density |
an integer specifying the number of equally spaced points at which the density is to be estimated. |
cexbox |
a numerical value giving the amount by which the boxes should be magnified relative to the default. |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
f = c(rnorm(200),rnorm(200)+4) h = rf(500,15,15)*10 g = rnorm(300)+1 heatboxplot(h) heatboxplot(list(f=f,g=g),colpals=c("rdpu","greens"),labels=c("bimodal","unimodal"))
f = c(rnorm(200),rnorm(200)+4) h = rf(500,15,15)*10 g = rnorm(300)+1 heatboxplot(h) heatboxplot(list(f=f,g=g),colpals=c("rdpu","greens"),labels=c("bimodal","unimodal"))
A histogram with an additional color stripe based on a kernel density estimate.
heathist( x, breaks = 20, xlab = NULL, ylab = NULL, main = "heathist", colpal = "greys", rev = FALSE, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, nobox = FALSE, add.density = FALSE, col.density = "darkred", add.rug = TRUE, col.rug = "black", nrcol = 100, ... )
heathist( x, breaks = 20, xlab = NULL, ylab = NULL, main = "heathist", colpal = "greys", rev = FALSE, simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, nobox = FALSE, add.density = FALSE, col.density = "darkred", add.rug = TRUE, col.rug = "black", nrcol = 100, ... )
x |
a numeric vector. |
breaks |
a numeric value giving the breaks of the histogram. |
xlab |
x label, standard graphics parameter. |
ylab |
y label, standard graphics parameter. |
main |
title(s) of the plot, standard graphics parameter. |
colpal |
a character vector containing R built-in color names or a name of a |
rev |
logical: if |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
nobox |
logical: if |
add.density |
if |
col.density |
a R build-in color for the density line (if |
add.rug |
if |
col.rug |
a R build-in color for the rug (if |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
x = rnorm(1000,mean = sample(c(0,3),size = 1000,prob = c(0.4,0.6),replace = TRUE)) heathist(x,xlab="x",add.density=TRUE,col.rug="darkred") heathist(x,xlab="x",colpal = "matlablike")
x = rnorm(1000,mean = sample(c(0,3),size = 1000,prob = c(0.4,0.6),replace = TRUE)) heathist(x,xlab="x",add.density=TRUE,col.rug="darkred") heathist(x,xlab="x",colpal = "matlablike")
Pairwise visualization of two dimensional data in a three dimensional fashion facilitating a color encoded Kernel Density Estimation.
heatpairs( mat, main = "heatpairs", xlim = NULL, ylim = NULL, labels = NULL, add.points = FALSE, group = NULL, color.group = "magenta", method = "spearman", colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, pch = 19, cexplot = 0.5, cor.cex = 2.5, nrcol = 30, grid = 100, only = "none", add.contour = FALSE, nlevels = 10, color.contour = "black", greyscale = FALSE, log = "", ... )
heatpairs( mat, main = "heatpairs", xlim = NULL, ylim = NULL, labels = NULL, add.points = FALSE, group = NULL, color.group = "magenta", method = "spearman", colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, pch = 19, cexplot = 0.5, cor.cex = 2.5, nrcol = 30, grid = 100, only = "none", add.contour = FALSE, nlevels = 10, color.contour = "black", greyscale = FALSE, log = "", ... )
mat |
a matrix with numerical entries. |
main |
title(s) of the plot, standard graphics parameter. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
labels |
a character vector giving the labels to be shown on the diagonal. |
add.points |
logical: if |
group |
indices or rownames of 'mat' to be highlighted in all pairwise plots (not necessarily all). |
color.group |
R build-in color in which the 'group' of points should be highlighted. |
method |
a character specifying the correlation method to use ('spearman' (default), 'pearson' or 'kendall'). |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
rev |
logical: if |
pch |
plotting 'character'. This can either be a single character or an integer code for one of a set of graphics symbols. (see '?pch', to be passed to plot). |
cexplot |
a numerical value giving the amount by which the points should be magnified relative to the default. |
cor.cex |
a numerical value giving the amount by which the correlation characters should be magnified relative to the default. |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
grid |
an integer specifying the size of the grid used for the KDE. |
only |
a character string which contains 'x' if the density should only be computed for the x axis, 'y' for the y axis (defaults to 'none' for the two-dimensional case). |
add.contour |
logical: if |
nlevels |
an integer giving the number of levels of the contour lines. |
color.contour |
R build-in color for the contour lines. |
greyscale |
logical: if |
log |
a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic. |
... |
additional parameters to be passed to points and plot |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
points = 10^4 x = rnorm(points/2) x = c(x,x+2.5) y = x + rnorm(points,sd=0.75) x = sign(x)*abs(x)^1.3 mat = cbind(x,y,x + rnorm(points,sd=0.5)) colnames(mat) = c("x","y","z") rownames(mat) = 1:nrow(mat) heatpairs(mat,labels=c(expression(Xi),expression(Lambda),expression(Delta)))
points = 10^4 x = rnorm(points/2) x = c(x,x+2.5) y = x + rnorm(points,sd=0.75) x = sign(x)*abs(x)^1.3 mat = cbind(x,y,x + rnorm(points,sd=0.5)) colnames(mat) = c("x","y","z") rownames(mat) = 1:nrow(mat) heatpairs(mat,labels=c(expression(Xi),expression(Lambda),expression(Delta)))
Visualize two dimensional data in a three dimensional fashion facilitating a color encoded Kernel Density Estimation.
heatscatter( x, y, pch = 19, cexplot = 0.5, nrcol = 30, grid = 100, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, main = "heatscatter", cor = FALSE, method = "spearman", only = "none", add.contour = FALSE, nlevels = 10, color.contour = "black", greyscale = FALSE, log = "", ... )
heatscatter( x, y, pch = 19, cexplot = 0.5, nrcol = 30, grid = 100, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, main = "heatscatter", cor = FALSE, method = "spearman", only = "none", add.contour = FALSE, nlevels = 10, color.contour = "black", greyscale = FALSE, log = "", ... )
x |
a numeric vector. |
y |
a numeric vector. |
pch |
plotting 'character'. This can either be a single character or an integer code for one of a set of graphics symbols. (see '?pch', to be passed to plot). |
cexplot |
a numerical value giving the amount by which the points should be magnified relative to the default. |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
grid |
an integer specifying the size of the grid used for the KDE. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
rev |
logical: if |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
xlab |
x labels, standard graphics parameter. |
ylab |
y labels, standard graphics parameter. |
main |
title(s) of the plot, standard graphics parameter. |
cor |
logical: if |
method |
a character specifying the correlation method to use ('spearman' (default), 'pearson' or 'kendall'). |
only |
a character string which contains 'x' if the density should only be computed for the x axis, 'y' for the y axis (defaults to 'none' for the two-dimensional case). |
add.contour |
logical: if |
nlevels |
an integer giving the number of levels of the contour lines. |
color.contour |
R build-in color for the contour lines. |
greyscale |
logical: if |
log |
a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic. |
... |
additional parameters to be passed to points and plot. |
Two-Dimensional Kernel Density Estimation adapted and modified from Venables and Ripley's MASS package (see reference).
Achim Tresch, Bjoern Schwalb
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
comparisonplot
, demotour
, disco
, colorpalette
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) y = x + rnorm(points,sd=0.8) x = sign(x)*abs(x)^1.3 heatscatter(x,y) heatscatter(x,y,colpal="bl2gr2rd",main="bl2gr2rd",cor=FALSE) heatscatter(x,y,cor=FALSE,add.contour=TRUE,color.contour="red",greyscale=TRUE) heatscatter(x,y,colpal="spectral",cor=FALSE,add.contour=TRUE)
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) y = x + rnorm(points,sd=0.8) x = sign(x)*abs(x)^1.3 heatscatter(x,y) heatscatter(x,y,colpal="bl2gr2rd",main="bl2gr2rd",cor=FALSE) heatscatter(x,y,cor=FALSE,add.contour=TRUE,color.contour="red",greyscale=TRUE) heatscatter(x,y,colpal="spectral",cor=FALSE,add.contour=TRUE)
Visualize two dimensional data in a three dimensional fashion facilitating a color encoded Kernel Density Estimation (add to an existing plot).
heatscatterpoints( x, y, pch = 19, cexplot = 0.5, nrcol = 30, grid = 100, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, xlim = NULL, ylim = NULL, only = "none", add.contour = FALSE, nlevels = 10, color.contour = "black", greyscale = FALSE, log = "", ... )
heatscatterpoints( x, y, pch = 19, cexplot = 0.5, nrcol = 30, grid = 100, colpal = "heat", simulate = FALSE, daltonize = FALSE, cvd = "p", alpha = NULL, rev = FALSE, xlim = NULL, ylim = NULL, only = "none", add.contour = FALSE, nlevels = 10, color.contour = "black", greyscale = FALSE, log = "", ... )
x |
a numeric vector. |
y |
a numeric vector. |
pch |
plotting 'character'. This can either be a single character or an integer code for one of a set of graphics symbols. (see '?pch', to be passed to plot). |
cexplot |
a numerical value giving the amount by which the points should be magnified relative to the default. |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified). |
grid |
an integer specifying the size of the grid used for the KDE. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
rev |
logical: if |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
only |
a character string which contains 'x' if the density should only be computed for the x axis, 'y' for the y axis (defaults to 'none' for the two-dimensional case). |
add.contour |
logical: if |
nlevels |
an integer giving the number of levels of the contour lines. |
color.contour |
R build-in color for the contour lines. |
greyscale |
logical: if |
log |
a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic. |
... |
additional parameters to be passed to points and plot. |
Two-Dimensional Kernel Density Estimation adapted and modified from Venables and Ripley's MASS package (see reference).
Bjoern Schwalb
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
comparisonplot
, demotour
, disco
, colorpalette
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) y = x + rnorm(points,sd=0.8) x = sign(x)*abs(x)^1.3 plot.new() plot.window(xlim = c(-5,15),ylim = c(-4,8)) heatscatterpoints(x,y,add.contour=TRUE,color.contour="green",greyscale=TRUE) axis(1) axis(2) box()
points = 10^4 x = c(rnorm(points/2),rnorm(points/2)+4) y = x + rnorm(points,sd=0.8) x = sign(x)*abs(x)^1.3 plot.new() plot.window(xlim = c(-5,15),ylim = c(-4,8)) heatscatterpoints(x,y,add.contour=TRUE,color.contour="green",greyscale=TRUE) axis(1) axis(2) box()
Homer Simpson as a list!
homer
homer
This list contains 31 character vectors of length 22 encoding Homer Simpson.
Create circles for visualizing overlaps between up to 4 datasets.
intersphere( data, colors = NULL, alpha = 25, cex = 1, expand.circles = 1, expand.lims = 1.5, main = "intersphere: overlap diagram", onlySets = seq(length(data), 2, by = -1) )
intersphere( data, colors = NULL, alpha = 25, cex = 1, expand.circles = 1, expand.lims = 1.5, main = "intersphere: overlap diagram", onlySets = seq(length(data), 2, by = -1) )
data |
a list with n entries having elements that can be represented as sets (have union and intersect methods). |
colors |
a character vector of R build-in colors for circles representing different sets. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
cex |
a numeric value giving the character expansion factor for intersect size text inside each circle. |
expand.circles |
a numeric value giving the expansion factor of circles (multiplicative). |
expand.lims |
a numeric value giving the expansion of x and y limits (additive). |
main |
title(s) of the plot, standard graphics parameter. |
onlySets |
vectors, which n-overlaps should be shown, default to all 1 < n < length(data). |
Sebastian Duemcke, Bjoern Schwalb
data = list( "A" = sample(1:200,100), "B" = sample(1:200,150), "C" = sample(1:200,50)) intersphere(data,colors = c("orange","skyblue","green")) data = list( "A" = sample(1:200,100), "B" = sample(1:200,150), "C" = sample(1:200,50), "D" = sample(1:200,75)) colors = c("orange","skyblue","green","purple") intersphere(data,colors,expand.circles = 0.5,expand.lims = 0.5)
data = list( "A" = sample(1:200,100), "B" = sample(1:200,150), "C" = sample(1:200,50)) intersphere(data,colors = c("orange","skyblue","green")) data = list( "A" = sample(1:200,100), "B" = sample(1:200,150), "C" = sample(1:200,50), "D" = sample(1:200,75)) colors = c("orange","skyblue","green","purple") intersphere(data,colors,expand.circles = 0.5,expand.lims = 0.5)
Visualize one-dimensional data in its every detail.
linesplot( x, labels = NULL, col = "black", cols = NULL, alpha = 25, xlim = NULL, ylim = NULL, xlab = NULL, ylab = "", las = 1, outline = TRUE, cexbox = 0.6, addboxes = FALSE, border = "black", range = 1.5, lwd = 1.5, main = "LSD.linesplot", ... )
linesplot( x, labels = NULL, col = "black", cols = NULL, alpha = 25, xlim = NULL, ylim = NULL, xlab = NULL, ylab = "", las = 1, outline = TRUE, cexbox = 0.6, addboxes = FALSE, border = "black", range = 1.5, lwd = 1.5, main = "LSD.linesplot", ... )
x |
numeric data as vector, matrix, list or data.frame. |
labels |
a character vector of labels. |
col |
a R build-in color. |
cols |
a character vector of R build-in colors. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
xlab |
x label, standard graphics parameter. |
ylab |
y label, standard graphics parameter. |
las |
las=1: horizontal text, las=2: vertical text (x-axis labels). |
outline |
logical: if |
cexbox |
a numerical value giving the amount by which the boxes should be magnified relative to the default. |
addboxes |
logical: if |
border |
a R build-in color for the box and the whiskers (if |
range |
this determines how far the plot whiskers extend out from the box. |
lwd |
linewidth of the box and whiskers. |
main |
title(s) of the plot, standard graphics parameter. |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
l = list() for (i in 1:10){l[[i]] = rnorm(100,sqrt(i^2.5),1+i/2)} linesplot(l,alpha=25,border="darkred",addboxes = TRUE,outline=FALSE)
l = list() for (i in 1:10){l[[i]] = rnorm(100,sqrt(i^2.5),1+i/2)} linesplot(l,alpha=25,border="darkred",addboxes = TRUE,outline=FALSE)
Piecharts at arbitrary position and radii.
LSD.pie( props, x = 0, y = 0, radius = 1, colpal = "prgn", simulate = FALSE, daltonize = FALSE, cvd = "p", edges = 1000, add = FALSE, xlim = c(-1, 1), ylim = c(-1, 1), main = "LSD.pie: piecharts", alpha = NULL, addPercent = FALSE, textcol = "black", clockwise = FALSE, init.angle = 0, labels = c(), cex = 1, cex.percentage = cex, border = NA, ... )
LSD.pie( props, x = 0, y = 0, radius = 1, colpal = "prgn", simulate = FALSE, daltonize = FALSE, cvd = "p", edges = 1000, add = FALSE, xlim = c(-1, 1), ylim = c(-1, 1), main = "LSD.pie: piecharts", alpha = NULL, addPercent = FALSE, textcol = "black", clockwise = FALSE, init.angle = 0, labels = c(), cex = 1, cex.percentage = cex, border = NA, ... )
props |
a numeric vector giving the relations of the pie pieces (need not to be normalized). |
x |
x-position of the piechart. |
y |
y-position of the piechart. |
radius |
a numeric value giving the radius of the piechart. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
edges |
an integer giving the number of edges the "circle" will have. |
add |
logical: if |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
main |
title(s) of the plot, standard graphics parameter. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
addPercent |
logical: if |
textcol |
a R build-in color for the percentages of |
clockwise |
if |
init.angle |
a numerical value representing an angle as a starting angle for the drawn slices. |
labels |
a character vector giving the names for the pie slices. |
cex |
scaling a numeric value giving the expansion factor for the slice names (if labels are given). |
cex.percentage |
a numeric value giving the expansion factor for the percentage values (if |
border |
a R build-in color giving the border color (NA by default). |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb, Carina Demel
emptyplot(xlim=c(1,9),ylim=c(1,9)) mtext(paste("LSD.pie: piecharts"),3,2,cex=1.25) polygon(c(4,2,4,7,8),c(4,8,4,2,8)) LSD.pie(sample(1:50,5),4,4,add=TRUE,radius=2,colpal="prgn",alpha=75) LSD.pie(sample(1:50,5),2,8,add=TRUE,colpal="prgn",alpha=75) LSD.pie(sample(1:50,5),8,8,add=TRUE,colpal="prgn",alpha=75) LSD.pie(sample(1:50,5),7,2,add=TRUE,colpal="prgn",alpha=75)
emptyplot(xlim=c(1,9),ylim=c(1,9)) mtext(paste("LSD.pie: piecharts"),3,2,cex=1.25) polygon(c(4,2,4,7,8),c(4,8,4,2,8)) LSD.pie(sample(1:50,5),4,4,add=TRUE,radius=2,colpal="prgn",alpha=75) LSD.pie(sample(1:50,5),2,8,add=TRUE,colpal="prgn",alpha=75) LSD.pie(sample(1:50,5),8,8,add=TRUE,colpal="prgn",alpha=75) LSD.pie(sample(1:50,5),7,2,add=TRUE,colpal="prgn",alpha=75)
Interpolate rows of a matrix to yield a smooth transitions.
makemovie(input, timepoints = NULL, timestep = 1, motionline = NULL)
makemovie(input, timepoints = NULL, timestep = 1, motionline = NULL)
input |
a matrix with numerical entries. |
timepoints |
a integer vector containing the timepoints corresponding to the columns of 'input'. |
timestep |
a non-negative integer specifying the number of timesteps between the existing timepoints (defaults to |
motionline |
a integer vector giving the timepoints of the resulting matrix (derived from timepoints and timesteps by default). |
Achim Tresch, Bjoern Schwalb
len = 10 x = sin(seq(0,2*pi,length=len*2)) fun = function(){n=sample(1:len,1);return(x[n:(n+len-1)])} input = t(replicate(7,fun(),simplify=TRUE)) input = input + rnorm(length(input))/2 par(mfrow=c(1,2)) plotmatrix(input,main="original",cols=1:7,type="o") mov = makemovie(input,timestep=0.2) plotmatrix(mov,main="interpolated",cols=1:7,type="o")
len = 10 x = sin(seq(0,2*pi,length=len*2)) fun = function(){n=sample(1:len,1);return(x[n:(n+len-1)])} input = t(replicate(7,fun(),simplify=TRUE)) input = input + rnorm(length(input))/2 par(mfrow=c(1,2)) plotmatrix(input,main="original",cols=1:7,type="o") mov = makemovie(input,timestep=0.2) plotmatrix(mov,main="interpolated",cols=1:7,type="o")
Depict a numeric matrix or list utilizing the underlying mean and standard deviation estimates of one dimension in a color encoded fashion.
msdplot( input, label = NULL, at = NULL, xlim = NULL, ylim = NULL, xlab = "", ylab = "", main = "msdplot", xaxt = "s", xlabels = NULL, las = 1, separate = TRUE, size = TRUE, col = "darkgreen", bars = TRUE, alpha = 50, ... )
msdplot( input, label = NULL, at = NULL, xlim = NULL, ylim = NULL, xlab = "", ylab = "", main = "msdplot", xaxt = "s", xlabels = NULL, las = 1, separate = TRUE, size = TRUE, col = "darkgreen", bars = TRUE, alpha = 50, ... )
input |
matrix or list with numerical entries, quantiles of cols will define lines. |
label |
a character vector assigning rows/elements of 'input' to clusters (if specified, multiple clusters can be depicted in different colors and/or subsequent plots). |
at |
a integer vector containing the x-positions corresponding to the columns of 'input'. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
xlab |
x labels, standard graphics parameter. |
ylab |
y labels, standard graphics parameter. |
main |
title(s) of the plot, standard graphics parameter. |
xaxt |
a character which specifies the x axis type ("n" suppresses plotting of the axis). |
xlabels |
a character vector containing labels for the x-axis. |
las |
las=1: horizontal text, las=2: vertical text (x-axis labels). |
separate |
if |
size |
logical: if |
col |
a character vector giving R build-in colors for different clusters. |
bars |
logical: if |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
... |
additional parameters to be passed to points and plot. |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
at = c(2,4,8,16,32) clus = matrix(rnorm(500,sd=0.5),ncol=5) batch = sample(c(-8,-6,-4,-2),100,replace=TRUE) clus = clus + cbind(0,0.25*batch,0.5*batch,0.75*batch,batch) clus = clus - clus[,1] clus = t(t(clus)*c(0,0.1,0.25,0.5,1)) labs = paste("cluster",kmeans(clus,4)$cluster) colpal = c("darkgreen","darkblue","darkred","black") msdplot(clus,labs,at,separate=FALSE,col=colpal,alpha=25,xlabels=at) msdplot(clus,labs,at,col=colpal,alpha=50,xlabels=at)
at = c(2,4,8,16,32) clus = matrix(rnorm(500,sd=0.5),ncol=5) batch = sample(c(-8,-6,-4,-2),100,replace=TRUE) clus = clus + cbind(0,0.25*batch,0.5*batch,0.75*batch,batch) clus = clus - clus[,1] clus = t(t(clus)*c(0,0.1,0.25,0.5,1)) labs = paste("cluster",kmeans(clus,4)$cluster) colpal = c("darkgreen","darkblue","darkred","black") msdplot(clus,labs,at,separate=FALSE,col=colpal,alpha=25,xlabels=at) msdplot(clus,labs,at,col=colpal,alpha=50,xlabels=at)
Plotting wrapper function to save plots in R as "pdf", "ps", "jpeg", "png", "bmp" or "tiff".
plotit( filename, sw = 1, sh = 1, sres = 1, plotsfkt, ww = 7, wh = 7, pointsize = 12, dev.pointsize = 8, paper = "special", quality = 100, units = "px", bg = "white", fileformat = "jpeg", saveit = FALSE, notinR = FALSE, addformat = NULL )
plotit( filename, sw = 1, sh = 1, sres = 1, plotsfkt, ww = 7, wh = 7, pointsize = 12, dev.pointsize = 8, paper = "special", quality = 100, units = "px", bg = "white", fileformat = "jpeg", saveit = FALSE, notinR = FALSE, addformat = NULL )
filename |
name of the plot to be saved with the format type suffix. |
sw |
scaling factor of weight. |
sh |
scaling factor of height. |
sres |
scaling factor of the resolution. |
plotsfkt |
list of plots to be plotted. |
ww |
width of window. |
wh |
height of window. |
pointsize |
the default pointsize of plotted text, interpreted as big points (1/72 inch) for plots to be saved. |
dev.pointsize |
pointsize of plotted text, interpreted as big points (1/72 inch) for display in R. |
paper |
needed only if filformat = "pdf" or "ps". |
quality |
needed only if filformat = "jpeg". |
units |
needed only if filformat = "jpeg", "png", "bmp" or "tiff". |
bg |
backgroundcolor. |
fileformat |
save the plot as "pdf", "ps", "jpeg", "png", "bmp" or "tiff". |
saveit |
should plot be saved. |
notinR |
should plot be not plotted in R. |
addformat |
should plot be saved additionally in another format ("pdf", "ps", "jpeg", "png", "bmp" or "tiff"). |
Bjoern Schwalb
data(homer) plotsfkt = function(){ colpal = c("white","black","yellow","wheat3") align(homer,colpal = colpal,main = "D'OH!",asp = 1,axes = FALSE) } # choose 'saveit = TRUE' for saving the plot in the specified fileformat # # choose 'notinR = TRUE' to suppress plotting in R # plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "jpeg") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "png") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "bmp") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "tiff") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "ps") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "pdf")
data(homer) plotsfkt = function(){ colpal = c("white","black","yellow","wheat3") align(homer,colpal = colpal,main = "D'OH!",asp = 1,axes = FALSE) } # choose 'saveit = TRUE' for saving the plot in the specified fileformat # # choose 'notinR = TRUE' to suppress plotting in R # plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "jpeg") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "png") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "bmp") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "tiff") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "ps") plotit("homer",sw = 2,sh = 2,sres = 2,plotsfkt,saveit = FALSE,notinR = FALSE,fileformat = "pdf")
Plot the rows of a matrix as lines along the cols.
plotmatrix( input, xlim = NULL, ylim = NULL, xlab = "", ylab = "", main = "plotmatrix", type = "l", lwd = 2, at = NULL, xlabels = NULL, ltys = NULL, add = FALSE, cols = NULL, ... )
plotmatrix( input, xlim = NULL, ylim = NULL, xlab = "", ylab = "", main = "plotmatrix", type = "l", lwd = 2, at = NULL, xlabels = NULL, ltys = NULL, add = FALSE, cols = NULL, ... )
input |
a matrix with numerical entries. |
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
xlab |
x lab, standard graphics parameter. |
ylab |
y lab, standard graphics parameter. |
main |
title of the plot, standard graphics parameter. |
type |
what 'type' of plot should be drawn (to be passed to points). |
lwd |
a positive number giving the line width. |
at |
a integer vector containing the x-positions corresponding to the columns of 'input'. |
xlabels |
a character vector containing labels for the x-axis. |
ltys |
a numeric vector giving the line types for each row of 'input'. |
add |
logical: if |
cols |
a character vector of R build-in colors. |
... |
additional parameters to be passed to points and plot. |
Achim Tresch, Bjoern Schwalb
clusterplot
, demotour
, disco
, colorpalette
len = 20 x = sin(seq(0,2*pi,length=len*2)) fun = function(){n=sample(1:len,1); return(x[n:(n+len-1)])} input = t(replicate(7,fun(),simplify=TRUE)) input = input + rnorm(length(input))/2 plotmatrix(input,cols=1:7)
len = 20 x = sin(seq(0,2*pi,length=len*2)) fun = function(){n=sample(1:len,1); return(x[n:(n+len-1)])} input = t(replicate(7,fun(),simplify=TRUE)) input = input + rnorm(length(input))/2 plotmatrix(input,cols=1:7)
TATAbox containing DNA-sequences!
seqs
seqs
This list contains 20 character vectors of TATAbox containing DNA-sequences of length 30.
Depict a numeric matrix or list utilizing the underlying distribution quantiles of one dimension in a color encoded fashion (add to an existing plot).
singleclusterplot( input, at = NULL, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "lightgrey", rev = FALSE, alpha = NULL, quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE )
singleclusterplot( input, at = NULL, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "lightgrey", rev = FALSE, alpha = NULL, quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE )
input |
matrix or list with numerical entries. |
at |
a integer vector containing the x-positions corresponding to the columns of 'input'. |
fromto |
a numeric vector containing the range of quantiles (between 0 and 1) to be plotted. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 25, if not specified). |
outer.col |
R built-in color to be used for outlier lines (lines outside of 'fromto'). |
rev |
logical: if |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
quartiles.col |
a character vector containing three R built-in colors for quartile lines (c('0.25','0.5','0.75')). |
add.quartiles |
logical: if |
Achim Tresch, Bjoern Schwalb
clusterplot
, align
, demotour
, disco
, colorpalette
samples = 100 probes = 200 clus = matrix(rnorm(probes*samples,sd=1),ncol=probes) clus = rbind( t(t(clus)+sin(1:probes/10))+1:nrow(clus)/samples, t(t(clus)+sin(pi/2+1:probes/10))+1:nrow(clus)/samples) emptyplot(xlim = c(1,ncol(clus)),ylim = range(clus)) singleclusterplot(clus) axis(1) axis(2) box()
samples = 100 probes = 200 clus = matrix(rnorm(probes*samples,sd=1),ncol=probes) clus = rbind( t(t(clus)+sin(1:probes/10))+1:nrow(clus)/samples, t(t(clus)+sin(pi/2+1:probes/10))+1:nrow(clus)/samples) emptyplot(xlim = c(1,ncol(clus)),ylim = range(clus)) singleclusterplot(clus) axis(1) axis(2) box()
Depict a numeric matrix or list utilizing the underlying distribution quantiles of one dimension in a color encoded fashion (add to an existing plot).
singlefusionplot( x, y, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "grey", rev = FALSE, alpha = NULL, quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE )
singlefusionplot( x, y, fromto = c(0.05, 0.95), colpal = "standardheat", simulate = FALSE, daltonize = FALSE, cvd = "p", nrcol = 25, outer.col = "grey", rev = FALSE, alpha = NULL, quartiles.col = c("grey", "black", "grey"), add.quartiles = TRUE )
x |
a numeric vector. |
y |
a numeric vector. |
fromto |
a numeric vector containing the range of quantiles (between 0 and 1) to be plotted. |
colpal |
a character vector containing R built-in color names or a name of a |
simulate |
logical: if |
daltonize |
logical: if |
cvd |
character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope). |
nrcol |
a non-negative integer specifying the number of colors to be used (defaults to 25, if not specified). |
outer.col |
R built-in color to be used for outlier lines (lines outside of 'fromto'). |
rev |
logical: if |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
quartiles.col |
a character vector containing three R built-in colors for quartile lines (c('0.25','0.5','0.75')). |
add.quartiles |
logical: if |
Achim Tresch, Bjoern Schwalb
fusionplot
, align
, demotour
, disco
, colorpalette
x = 1:1000/300 y = rnorm(1000)+sin(2*x)*3 emptyplot(xlim = range(x),ylim = range(y)) singlefusionplot(x,y,colpal = "ylgnbu") axis(1) axis(2) box()
x = 1:1000/300 y = rnorm(1000)+sin(2*x)*3 emptyplot(xlim = range(x),ylim = range(y)) singlefusionplot(x,y,colpal = "ylgnbu") axis(1) axis(2) box()
Depict a numeric matrix or list utilizing the underlying mean and standard deviation estimates of one dimension in a color encoded fashion (add to an existing plot).
singlemsdplot( input, col = "darkgreen", alpha = 50, bars = TRUE, length = 0.25, at = NULL )
singlemsdplot( input, col = "darkgreen", alpha = 50, bars = TRUE, length = 0.25, at = NULL )
input |
data as matrix or list. |
col |
a character vector of R build-in colors. |
alpha |
alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default). |
bars |
logical: if |
length |
a numeric value scaling the width of the bars. |
at |
a integer vector containing the x-positions corresponding to the columns of 'input'. |
Bjoern Schwalb
comparisonplot
, demotour
, disco
, colorpalette
samples = 100 probes = 200 clus = matrix(rnorm(probes*samples,sd=1),ncol=probes) clus = rbind( t(t(clus)+sin(1:probes/10))+1:nrow(clus)/samples, t(t(clus)+sin(pi/2+1:probes/10))+1:nrow(clus)/samples) emptyplot(xlim = c(1,ncol(clus)),ylim = range(clus)) singlemsdplot(clus) axis(1) axis(2) box()
samples = 100 probes = 200 clus = matrix(rnorm(probes*samples,sd=1),ncol=probes) clus = rbind( t(t(clus)+sin(1:probes/10))+1:nrow(clus)/samples, t(t(clus)+sin(pi/2+1:probes/10))+1:nrow(clus)/samples) emptyplot(xlim = c(1,ncol(clus)),ylim = range(clus)) singlemsdplot(clus) axis(1) axis(2) box()
Adds a colored rectangular grid to an existing plot.
webdesign(xlim, ylim, colpal = "rdbu", xlabels = NULL, ylabels = NULL, ...)
webdesign(xlim, ylim, colpal = "rdbu", xlabels = NULL, ylabels = NULL, ...)
xlim |
x limits, standard graphics parameter. |
ylim |
y limits, standard graphics parameter. |
colpal |
a character vector containing R built-in color names or a name of a |
xlabels |
a character vector containing labels depicted parallel to the x-axis. |
ylabels |
a character vector containing labels depicted parallel to the y-axis. |
... |
additional parameters to be passed to abline(). |
Bjoern Schwalb
emptyplot(c(-5,5),c(-5,5)) labels = c("2 fold","4 fold","8 fold") webdesign(c(-5,5),c(-5,5),lty = 2,xlabels = labels,ylabels = labels)
emptyplot(c(-5,5),c(-5,5)) labels = c("2 fold","4 fold","8 fold") webdesign(c(-5,5),c(-5,5),lty = 2,xlabels = labels,ylabels = labels)
Create a factorization of the number of windows for plots with device partitions to be used in par(mfrow = ...).
windowxy(nrwin = 1)
windowxy(nrwin = 1)
nrwin |
a non-negative integer specifying the number of windows. |
Bjoern Schwalb
windowxy(20)
windowxy(20)