method to plot a scale in image plot.

addscale(
  z,
  zlim = range(z, na.rm = TRUE),
  col = grDevices::heat.colors(12),
  breaks = pretty(zlim),
  horiz = TRUE,
  ylim = NULL,
  xlim = NULL,
  ...
)

Arguments

z

matrix or vector

zlim

z limit

col

color

breaks

interval for the tickmarks

horiz

TRUE (default) to a horizontal scale

ylim

y limitS

xlim

x limit

...

other arguments to plot

Examples

if (FALSE) { # \dontrun{
mat <- matrix(100:1,ncol = 10, byrow = F)
cor <- grDevices::heat.colors(100)
image(mat,axe = FALSE, main = "numbers from 1 to 100", col = cor)
axis(2)
addscale(mat, col = cor)
} # }