Function Repository Resource:

# DiscreteIntegralPlot

Plot and find the area of a region determined by a list of points, the x axis and the type of boundary

Contributed by: Dennis M Schneider
 ResourceFunction["DiscreteIntegralPlot"][data,method] plots the region determined by data, the x-axis and the type of boundary and prints the area of that the region.

## Details and Options

"DrawGraph" is an option for ResourceFunction["DiscreteIntegralPlot"] which, if set to False, will suppress the graph and just return the area of the region.
"PrintDisplay" is an option for ResourceFunction["DiscreteIntegralPlot"] which, if set to False, will suppress the printing of the area of the region.
Other options are those for Plot, ListPlot, ListLinePlot or Graphics.
The method can be specified as Left, Midpoint, Right, Upper, Lower, Trap, Simpson or Spline.

## Examples

### Basic Examples (1)

Plot data and determine the area of the region determined by data and the x-axis, using the left–hand endpoints as the height of the rectangles:

 In:= Out= ### Scope (6)

Use data given by a formula:

 In:= Out= Note the bad spots in this graph around x=0.6 and x=2.5. Plotting more points fixes the problem:

 In:= Out= Apply a style to the region:

 In:= Out= Apply a style to the points:

 In:= Out= Use Manipulate to illustrate all possible methods to be used:

 In:= Out= Setting the option "DrawGraph" to False suppresses the plot of the region and returns the area:

 In:= Out= ### Possible Issues (2)

Data must be ordered:

 In:=  Simpson's method requires an even number of subintervals and the range should be chosen accordingly:

 In:=  In:= Out= ## Publisher

Dennis M Schneider

## Version History

• 1.0.0 – 02 August 2019