Description Usage Arguments Examples
View source: R/autoplot_mesh.R
An autoplot (ggplot2) method for INLA mesh objects.
1 2 3 |
object |
An inla.mesh object |
... |
Other arguments passed to specific methods |
col |
Colour for data points |
lwd |
Line width |
linecol |
The colour for the mesh edges |
size |
size Size of data points |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## 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")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.