Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

annotation_raster_tern

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

An Extension to 'ggplot2', for the Creation of Ternary Diagrams

v3.3.0
GPL-2 | file LICENSE
Authors
Nicholas Hamilton [aut, cre]
Initial release
2020-04-9

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.