annotation_raster_tern: Annotation: High-performance rectangular tiling (ggtern...

View source: R/annotation-raster-tern.R

annotation_raster_ternR Documentation

Annotation: High-performance rectangular tiling (ggtern version)

Description

This is a special version of geom_raster optimised for static annotations that are the same in every panel. These annotations will not affect scales (i.e. the x and y axes will not grow to cover the range of the raster, and the raster must already have its own colours).

Usage

annotation_raster_tern(
  raster,
  xmin = 0,
  xmax = 1,
  ymin = 0,
  ymax = 1,
  interpolate = FALSE
)

Arguments

raster

raster object to display

xmin, xmax

x location (in npc coordinates) giving horizontal location of raster

ymin, ymax

y location (in npc coordinates) giving vertical location of raster

interpolate

If TRUE interpolate linearly, if FALSE (the default) don't interpolate.

Details

Most useful for adding bitmap images.

Author(s)

Nicholas Hamilton

Examples

data(Feldspar)
data(FeldsparRaster)
ggtern(Feldspar,aes(Ab,An,Or)) + 
theme_rgbw() + 
annotation_raster_tern(FeldsparRaster,xmin=0,xmax=1,ymin=0,ymax=1) +
geom_mask() + 
geom_point(size=5,aes(shape=Feldspar,fill=Feldspar),color='black') +
scale_shape_manual(values=c(21,24)) +
labs(title="Demonstration of Raster Annotation")

ggtern documentation built on June 22, 2024, 11:01 a.m.