plot_curve_area: Plot Filled Area Below a Curve Line

View source: R/curve_areas.R

plot_curve_areaR Documentation

Plot Filled Area Below a Curve Line

Description

Plot Filled Area Below a Curve Line

Usage

plot_curve_area(x, y, y.base = 0, col = NA, ...)

Arguments

x

vector of x coordinates

y

vector of y coordinates

y.base

y coordinate of horizontal line that closes the area

col

colour of area to be plotted. Default: NA

...

further arguments given to polygon such as border (colour of the border of the polygon)

Examples

  x <- seq(-pi, pi, pi/8)
  y <- sin(x)
  
  plot(x, y)
  plot_curve_area(x, y, 0, col = "red")
  
  plot(x, y)
  plot_curve_area(x, y, -1, col = "red")
  plot_curve_area(x, y, 1, col = "green")
  

KWB-R/kwb.plot documentation built on Oct. 2, 2023, 10:16 p.m.