Skip to main content

Function Signature

plot(x, y, ...)

Description

Plot methods for Intensity objects based on Intensity Analysis output. The plot() function is an S4 method with specialized implementations for three different object types: Interval, Category, and Transition. Each plot type visualizes a different level of the intensity analysis, creating publication-ready graphics that help interpret land use and cover change patterns.

Methods

Interval Level Plot

plot(
  x,
  y,
  labels = c(
    leftlabel = "Interval Change Area (percent of map)",
    rightlabel = "Annual Change Area (percent of map)"
  ),
  title = NA,
  labs = c(type = "Changes", ur = "Uniform Intensity"),
  marginplot = c(lh = -10, rh = 0),
  leg_curv = c(x = 0.1, y = 0.1),
  color_bar = c(fast = "#B22222", slow = "#006400", area = "gray40"),
  fontsize_ui = 10,
  ...
)
Plots the interval level analysis showing how the size and speed of change vary across time intervals.

Category Level Plot

plot(
  x,
  y,
  labels = c(
    leftlabel = "Annual Change Area (km2 or pixels)",
    rightlabel = "Annual Change Intensity (percent of category)"
  ),
  title = NA,
  labs = c(type = "Categories", ur = "Uniform Intensity"),
  marginplot = c(lh = 0.5, rh = 0.5),
  leg_curv = c(x = 0.1, y = 0.1),
  fontsize_ui = 10,
  ...
)
Plots the category level analysis showing gross losses or gross gains for each category.

Transition Level Plot

plot(
  x,
  y,
  labels = c(
    leftlabel = "Annual Transition Area (km2 or pixels)",
    rightlabel = "Annual Transition Intensity (percent of category)"
  ),
  title = NA,
  labs = c(type = "Categories", ur = "Uniform Intensity"),
  marginplot = c(lh = 0.5, rh = 0.5),
  leg_curv = c(x = 0.1, y = 0.1),
  fontsize_ui = 10,
  ...
)
Plots the transition level analysis showing transitions to or from a specific category.

Parameters

x
Interval | Category | Transition
required
An intensity object generated by intensityAnalysis(). The type of object determines which plot method is called:
  • Interval object: plots interval level analysis
  • Category object: plots category level analysis (gain or loss)
  • Transition object: plots transition level analysis (gain or loss)
y
any
Ignored. Included for S4 method compatibility.
labels
character vector
Left and right axis titles (captions). Provide as a named vector:
  • leftlabel: Title for the left axis (typically area values)
  • rightlabel: Title for the right axis (typically intensity values)
Default values vary by plot type.
title
character
default:"NA"
Main title for the plot. If NA (default), no title is displayed.
labs
character vector
Legend labels. Provide as a named vector:
  • type: Label for the category/change type legend
  • ur: Label for the uniform intensity reference line
Defaults vary by plot type.
marginplot
numeric vector
Adjustment of the origins of left and right parts of the plots. Provide as a named vector:
  • lh: Left margin adjustment (in points)
  • rh: Right margin adjustment (in points)
Defaults vary by plot type. Use negative values to bring panels closer together.
leg_curv
numeric vector
X and Y values that control the arrow size and position pointing to the Uniform Intensity vertical line. Provide as a named vector:
  • x: Horizontal offset for the arrow endpoint
  • y: Vertical offset for the arrow endpoint
Default: c(x = 0.1, y = 0.1)
color_bar
character vector
Colors defined for the fast, slow, and area bars. Only applicable for Interval objects. Provide as a named vector:
  • fast: Color for fast change intervals (default: "#B22222" - firebrick red)
  • slow: Color for slow change intervals (default: "#006400" - dark green)
  • area: Color for area bars (default: "gray40")
fontsize_ui
numeric
default:"10"
Font size of the uniform intensity percentage label in the plot.
...
additional arguments
Additional arguments passed to ggplot2::theme() for further plot customization. See ggplot2::theme() documentation for available options.

Return Value

Returns an intensity graph as a grid object, which is automatically displayed. The plot uses ggplot2 and gridExtra for rendering.

Examples

Plotting Interval Level Analysis

# Perform intensity analysis
result <- intensityAnalysis(
  dataset = SL_2002_2014,
  category_n = "Ap",
  category_m = "SG",
  area_km2 = TRUE
)

# Plot interval level with default settings
plot(result$interval_lvl)

# Plot with custom title and labels
plot(
  result$interval_lvl,
  title = "Interval Level Intensity Analysis",
  labels = c(
    leftlabel = "Interval Change (%)",
    rightlabel = "Annual Change (%)"
  )
)

# Customize colors and appearance
plot(
  result$interval_lvl,
  color_bar = c(fast = "red", slow = "blue", area = "gray"),
  fontsize_ui = 12
)

Plotting Category Level Analysis

# Plot category level gains
plot(result$category_lvlGain)

# Plot category level losses with custom title
plot(
  result$category_lvlLoss,
  title = "Category Level: Losses",
  labs = c(type = "Land Categories", ur = "Uniform Rate")
)

# Adjust margins for better spacing
plot(
  result$category_lvlGain,
  marginplot = c(lh = 1, rh = 1)
)

Plotting Transition Level Analysis

# Plot transition level gains (transitions TO category_n)
plot(result$transition_lvlGain_n)

# Plot transition level losses (transitions FROM category_m)
plot(result$transition_lvlLoss_m)

# Customize arrow position and font size
plot(
  result$transition_lvlGain_n,
  leg_curv = c(x = 0.15, y = 0.2),
  fontsize_ui = 11
)

Advanced Customization with ggplot2 Theme

# Pass additional theme arguments for fine-tuned control
plot(
  result$interval_lvl,
  title = "Land Change Intensity Over Time",
  axis.text = element_text(size = 10),
  axis.title = element_text(size = 12, face = "bold"),
  legend.position = "bottom",
  panel.background = element_rect(fill = "white")
)

Understanding the Plots

Interval Level Plots

Interval level plots show:
  • Left panel: Total change area for each time interval
  • Right panel: Annual intensity of change with a uniform intensity reference line
  • Colors: Fast (above uniform) vs. slow (below uniform) change rates

Category Level Plots

Category level plots show:
  • Left panel: Gross gain or loss area for each category
  • Right panel: Annual intensity of gain or loss with uniform intensity reference
  • Facets: Separate panels for each time interval
  • Colors: Category-specific colors from the legend

Transition Level Plots

Transition level plots show:
  • Left panel: Transition area to/from the target category
  • Right panel: Transition intensity with uniform intensity reference
  • Facets: Separate panels for each time interval
  • Interpretation: Categories above the uniform line are “targeted” or “targeting”; those below are “avoided” or “avoiding”

See Also

Build docs developers (and LLMs) love