Provide a geom able to rasterize matrices faster than geom_raster()
.
You can install the development version of ggmatrix from GitHub with:
# install.packages("remotes")
remotes::install_github("zeehio/ggmatrix")
This is a basic example which shows you how to solve a common problem:
library(ggmatrix)
#> Loading required package: ggplot2
x_small <- c(3,5,7,9)
y_small <- c(100,200,300)
mat_small <- matrix(
seq(from = 1, to = length(x_small)*length(y_small)),
nrow = length(x_small),
ncol = length(y_small)
)
dimnames(mat_small) <- list("x label" = x_small, "y label" = y_small)
ggplot() + geom_matrix_raster(matrix = mat_small)