addPhylopic: Add transparency and/or change color of a picture

Description Usage Arguments Value Author(s) Examples

View source: R/addPhylopic.R

Description

This function recolours and plots a picture. Not perfect, needs improvement.

Usage

1
2
3
4
5
6
7
8
9
addPhylopic(
  img,
  x = NULL,
  y = NULL,
  ysize = NULL,
  alpha = 0.2,
  color = NULL,
  AR = 1
)

Arguments

img

array a picture loaded by png::readPNG().

x

numeric the x coordinate of the center of the picture.

y

numeric the y coordinate of the center of the picture.

ysize

numeric a facteur to resize picture dimensions.

alpha

numeric transparency factor between 0 (transparent) and 1 (opaque).

color

array a color name (e.g. "red", "steelblue") or an hexadecimal value (e.g. "#ff0000")

AR

array a magnification factor (zoom).

Value

This function returns a picture matrix with colors and/or transparency altered. This matrix can be plotted with the function graphics::rasterImage() (see examples).

Author(s)

Nicolas CASAJUS, nicolas.casajus@fondationbiodiversite.com

Examples

1
# No example.

FRBCesab/ecorar documentation built on June 2, 2021, 8:18 p.m.