# NOT RUN {
library(INLA)
m = 100
points = matrix(runif(m*2),m,2)
mesh = inla.mesh.create.helper(
points=points,
cutoff=0.05,
offset=c(0.1,0.4),
max.edge=c(0.05,0.5) )
autoplot(mesh)
p <- autoplot(mesh)
# As a ggplot2 object, the plot can be altered.
p + theme_dark()
# The size and colour of all objects can be controlled.
# The order of the values is
# 1: data points
# 2: edges
# 3: outer domain
# 4: inner domain
# 5: non data vertices
p + scale_colour_manual(values = c('red', 'grey', 'darkblue', 'steelblue', 'yellow'))
# The name of the variable that defines the different objects is 'type'
p + facet_grid(. ~ type)
# Plot projections with ggalt
library(ggalt)
p + ggalt::coord_proj("+proj=wintri")
# }
Run the code above in your browser using DataLab