Learn R Programming

mrf2d (version 0.2.0)

plot,mrfi,missing-method: Plotting of mrfi objects.

Description

Plots a visual representation of the interaction structure described in a mrfi object. The black tile represents a reference pixel and gray tiles are shown in relative positions with dependent pixels.

A ggplot object is used, therefore, the user can load the ggplot2 package and add more ggplot layers to freely customize the plot.

Usage

# S4 method for mrfi,missing
plot(x, no_axis = FALSE)

Arguments

x

A mrfi object.

no_axis

logical value indicating whether the axis and grid lines are used. If TRUE it simply adds theme_void() to the ggplot object.

Value

A ggplot object using geom_tile() to represent interacting relative positions.

Details

The data.frame used for the ggplot call has columns names rx and ry rep<U+0155>esenting the relative positions.

Examples

Run this code
# NOT RUN {
plot(mrfi(1))

library(ggplot2)
plot(mrfi(1)) + geom_tile(fill = "red")
plot(mrfi(1)) + geom_tile(fill = "blue") + theme_void()

plot(mrfi(1)) + geom_text(aes(label = paste0("(",rx,",",ry,")")))

# }

Run the code above in your browser using DataLab