pa_plot: Create a plot from a pacu object

View source: R/plot.R

pa_plotR Documentation

Create a plot from a pacu object

Description

Create a plot from a pacu object

Usage

pa_plot(x, ...)

## S3 method for class 'yield'
pa_plot(
  x,
  ...,
  plot.type = c("yieldmap", "variogram", "steps"),
  palette = "Temps",
  main = "",
  plot.var = NULL,
  interactive = FALSE,
  border.col = "black",
  style = c("quantile", "pretty", "equal"),
  scale = 1,
  nbreaks = 5,
  breaks = NULL,
  frame = TRUE,
  extent = sf::st_bbox(x[["yield"]]),
  legend.outside = FALSE,
  ask = TRUE
)

## S3 method for class 'trial'
pa_plot(
  x,
  ...,
  plot.type = c("trial"),
  palette = "Temps",
  main = "",
  plot.var = NULL,
  interactive = FALSE,
  border.col = "black",
  style = c("quantile", "pretty", "equal"),
  scale = 1,
  nbreaks = 5,
  breaks = NULL,
  frame = TRUE,
  extent = sf::st_bbox(x[["trial"]]),
  legend.outside = FALSE
)

## S3 method for class 'veg.index'
pa_plot(
  x,
  ...,
  palette = ifelse(plot.type == "timeseries", "Dark 2", "Temps"),
  plot.type = c("spatial", "timeseries"),
  main = "",
  plot.var = NULL,
  by = "year",
  xlab = NULL,
  ylab = NULL,
  style = c("quantile", "pretty", "equal"),
  nbreaks = 5,
  border.col = "black",
  frame = TRUE,
  legend.outside = FALSE,
  legend.title = NULL,
  pch = 16
)

## S3 method for class 'rgb'
pa_plot(
  x,
  ...,
  main = "",
  interactive = FALSE,
  saturation = 1,
  alpha = 1,
  interpolate = FALSE
)

## S3 method for class 'met'
pa_plot(
  x,
  ...,
  plot.type = c("climate_normals", "monthly_distributions"),
  unit.system = c("international", "standard"),
  start = 1,
  end = 365,
  months = 1:12,
  vars = c("maxt", "mint", "crain", "cradn"),
  tgt.year = "last"
)

Arguments

x

object to be plotted

...

additional arguments. None used currently.

plot.type

type of plot to be produced Defaults to trial.

palette

a string representing a color palette from hcl.pals. Defaults to ‘Temps’.

main

a main title for the plot

plot.var

the name of the column to be plotted. Defaults to ‘yield’

interactive

logical. Whether to produce interactive plots.

border.col

color of the border for the polygons plotted in the yield map

style

style applied to the colors

scale

a numerical value indicating the magnification of the graph. A value of 1 produces a plot using the default magnification. Greater values will produce zoomed in plots.

nbreaks

numerical value indicating the number of breaks for the color scale.

breaks

a vector indicating numerical breaks for the color scale.

frame

logical. Whether to draw the frame around the plotting area.

extent

a bbox object indicating the geographical area to be plotted

legend.outside

logical. Whether to place the legend outside of the graph.

ask

whether to ask for user before starting a new page of output. If FALSE, plots are arranged using wrap_plots

by

a string or vector of strings used to group the data when plotting. Defaults to 'year'

xlab

a string used as label for x axis

ylab

a string used as label for y axis

legend.title

a string used as title for the legend

pch

an integer indicating which shape to use for points

saturation

numeric. Controls the image saturation. 0 maps to grayscale. 1 maps to the default value. See tm_rgb for details.

alpha

numeric between 0 and 1. See tm_rgb for details.

interpolate

logical. Whether the raster image should be interpolated. See tm_rgb for details.

unit.system

unit system to be used: international (metric) or stanrdard (imperial)

start

day of the year to start computing the climate normals. Defaults to 1.

end

day of the year to finish computing the climate normals. Defaults to 365.

months

a numerical vector indicating which months to produce a plot for in the case of monthly distribution plots. Defaults to 1:12.

vars

which variables to include in the summary plot

tgt.year

which year to focus and compare to the historical mean. Defaults to the last year in the data set.

Value

No return value, called for side effects

Author(s)

Caio dos Santos and Fernando Miguez

Examples

## Not run: 
## for examples, please see the pacu vignette

## End(Not run)


pacu documentation built on June 8, 2025, 10:44 a.m.