Type: | Package |
Title: | Plotting Paintmaps |
Version: | 1.0 |
Date: | 2016-08-31 |
Author: | Daniel Greene |
Maintainer: | Daniel Greene <dg333@cam.ac.uk> |
Description: | Plots matrices of colours as grids of coloured squares - aka heatmaps, guaranteeing legible row and column names, without transformation of values, without re-ordering rows or columns, and without dendrograms. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | no |
Packaged: | 2016-08-31 15:50:44 UTC; dg333 |
Repository: | CRAN |
Date/Publication: | 2016-08-31 20:47:04 |
Plotting paintmaps
Description
Plots matrices of colours as grids of coloured squares - aka heatmaps, guaranteeing legible row and column names, without transformation of values, without re-ordering rows or columns, and without dendrograms.
Details
The function ‘bhm’ takes a matrix of colours (i.e. a character matrix of descriptions like red or hex-codes), and creates a plot using ‘grid’ graphics.
Author(s)
Daniel Greene Maintainer: Daniel Greene <dg333@cam.ac.uk>
Examples
paintmap(matrix(heat.colors(9), 3, 3, dimnames=list(letters[1:3], letters[4:6])))
Convert numeric matrix to color (character) matrix
Description
Given a numeric matrix, assign to each cell a color (character) value based on linearly interpolating a given vector of colors.
Usage
color_matrix(x, colors = heat.colors(10))
Arguments
x |
Numeric or logical matrix. |
colors |
Character vector of colors. |
Value
Character matrix.
Convert numeric matrix to colour (character) matrix
Description
Given a numeric matrix, assign to each cell a colour (character) value based on linearly interpolating a given vector of colours.
Usage
colour_matrix(x, colours = heat.colors(10))
Arguments
x |
Numeric or logical matrix. |
colours |
Character vector of colours. |
Value
Character matrix.
Get number of inches high a putative heatmap will be
Description
Get number of inches high a putative heatmap will be
Usage
inches_tall(x, row_lines = 1)
Arguments
x |
Character matrix of colours |
row_lines |
Numeric value determining number of lines width each row of the heatmap should occupy. |
Value
Numeric value.
Get number of inches across a putative heatmap will be
Description
Get number of inches across a putative heatmap will be
Usage
inches_wide(x, col_lines = 1)
Arguments
x |
Character matrix of colours |
col_lines |
Numeric value determining number of lines width each column of the heatmap should occupy. |
Value
Numeric value.
Lines of space between the heatmap and row/column labels
Description
Lines of space between the heatmap and row/column labels
Usage
lines_between_hm_and_labels
Format
An object of class numeric
of length 1.
Lines of space at margins of paintmap
Description
Lines of space at margins of paintmap
Usage
margin_lines
Format
An object of class numeric
of length 1.
Plot paintmap
Description
Plot paintmap
Usage
paintmap(x, add = FALSE, ...)
Arguments
x |
Character matrix of colours |
add |
Add ink to current viewport. |
... |
Other graphical parameters for the rectangles of the grid to pass to |
Value
Plots heatmap.
Examples
paintmap(matrix(heat.colors(9), 3, 3, dimnames=list(letters[1:3], letters[4:6])))