R/plot_color_matrix.R

Defines functions plot.color_matrix

Documented in plot.color_matrix

# Copyright (C) 2020 Sebastian Henz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see https://www.gnu.org/licenses/.


#' Plot color matrices
#'
#' Plot objects of class "color_matrix" as returned from e.g. [mandelbrot()] or
#' [sandpile()].
#'
#' @param x A matrix of color values.
#' @param ... Not used.
#'
#' @return None
#'
#' @examples plot(mandelbrot(width = 200, height = 150))
#'
#' @export
plot.color_matrix <- function(x, ...) {
    grid.newpage()
    grid.raster(x, interpolate = FALSE)
}
BastiHz/fractalplotr documentation built on Sept. 9, 2021, 4:46 a.m.