Skip to contents

Plot a segmetric map according to the parameter type:

  • "base": simple plot of the reference or segmentation polygons;

  • "subset": plot polygons from a subset over the base plot;

  • "choropleth": plot a choropleth map from polygons of a subset using metric values.

Usage

# S3 method for segmetric
plot(
  x,
  type = "base",
  ...,
  title = NULL,
  layers = c("ref_sf", "seg_sf"),
  background = "#FFFFFF",
  ref_color = "#FF00009F",
  ref_fill = "#FFFFFF00",
  ref_label = "reference",
  ref_size = 2,
  ref_symbol = 2,
  seg_color = "#0000009F",
  seg_fill = "#FFFFFF00",
  seg_label = "segment",
  seg_size = 1,
  seg_symbol = 3,
  selected_fill = "#9A9AFF50",
  plot_centroids = TRUE,
  centroids_color = "#000000FF",
  centroids_label = "centroid",
  subset_id = NULL,
  subset_color = "#FFFFFF00",
  subset_fill = "#F0E4167F",
  metric_id = NULL,
  break_style = "jenks",
  choropleth_palette = "YlGnBu",
  choropleth_palette_reverse = FALSE,
  choropleth_size = 0.1,
  plot_extent = NULL,
  plot_legend = TRUE,
  plot_axes = TRUE
)

Arguments

x

A segmetric object.

type

A character. Either "base", "subset", or "choropleth".

...

Ignored.

title

A character with plot title

layers

A character. One or both of "ref_sf" and "seg_sf" (works only for type = "base" and type = "subset").

background

A character with valid color used in graph's background.

ref_color, seg_color, ref_fill, seg_fill

A character with a valid hexadecimal color in rgb or rgba format. Set the border and fill colors for reference and segmentation polygons.

ref_label, seg_label, centroids_label

A character with legend labels for reference polygons, segmentation polygons, and centroids.

ref_size, seg_size

A numeric. Set symbol's size for centroids.

ref_symbol, seg_symbol

An integer. Symbol to represent polygons' centroids (see pch param in points).

selected_fill

A character with a valid hexadecimal color in rgb or rgba format. Set the fill color of selected reference or segmentation polygons depending on subset_id.

plot_centroids

A logical. Plot centroids or not.

centroids_color

A character with a valid hexadecimal color in rgb or rgba format. Set the border colors for centroids.

subset_id

A character with subset name (required for type = "subset")

subset_color, subset_fill

A character with a valid hexadecimal color in rgb or rgba format. Set the border and fill colors for subset polygons (works only with type = "subset").

metric_id

A character with metric to be plotted in choropleth maps (required for type = "choropleth")

break_style

A character with the name of a method to compute the intervals for choropleth maps. Can be one of "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", "dpih", and "headtails" (see style parameter in classIntervals).

choropleth_palette

A character with a valid palette to be used in choropleth plots.

choropleth_palette_reverse

A logical indicating if palette should be generated in reversely.

choropleth_size

A numeric with border size used to plot polygons.

plot_extent

A sf object. Set the map extent for a plot.

plot_legend

A logical. Plot legend or not.

plot_axes

A logical. Plot coordinates axis or not.