Skip to main content
added 4383 characters in body
Source Link
John
  • 710
  • 8
  • 13

I need to calculate the area enclosed in a two-dimensional listplot and following an answer to a similar question I tried this way:

imgnorm = (mnorm = MorphologicalComponents[ Erosion[Binarize[ ListLinePlot[{list}, ImageSize -> Large, Axes -> False]], 0.5]]) // Colorize listareas = {area1 = 1/. ComponentMeasurements[{mnorm, imgnorm}, "Area"], area2 = 2/. ComponentMeasurements[{mnorm, imgnorm}, "Area"]} 

It works fine, however it is not precise enough for what I need to do because part of the area is taken by the black line.

The list is quite big and the points don't form a polygon.

EDIT: Here is the plot:

list plot

Any help would be appreciated, thank you in advance.

I need to calculate the area enclosed in a two-dimensional listplot and following an answer to a similar question I tried this way:

imgnorm = (mnorm = MorphologicalComponents[ Erosion[Binarize[ ListLinePlot[{list}, ImageSize -> Large, Axes -> False]], 0.5]]) // Colorize listareas = {area1 = 1/. ComponentMeasurements[{mnorm, imgnorm}, "Area"], area2 = 2/. ComponentMeasurements[{mnorm, imgnorm}, "Area"]} 

It works fine, however it is not precise enough for what I need to do because part of the area is taken by the black line.

The list is quite big and the points don't form a polygon.

Any help would be appreciated, thank you in advance.

I need to calculate the area enclosed in a two-dimensional listplot and following an answer to a similar question I tried this way:

imgnorm = (mnorm = MorphologicalComponents[ Erosion[Binarize[ ListLinePlot[{list}, ImageSize -> Large, Axes -> False]], 0.5]]) // Colorize listareas = {area1 = 1/. ComponentMeasurements[{mnorm, imgnorm}, "Area"], area2 = 2/. ComponentMeasurements[{mnorm, imgnorm}, "Area"]} 

It works fine, however it is not precise enough for what I need to do because part of the area is taken by the black line.

The list is quite big and the points don't form a polygon.

EDIT: Here is the plot:

list plot

Any help would be appreciated, thank you in advance.

Source Link
John
  • 710
  • 8
  • 13

How to calculate the area of a listplot

I need to calculate the area enclosed in a two-dimensional listplot and following an answer to a similar question I tried this way:

imgnorm = (mnorm = MorphologicalComponents[ Erosion[Binarize[ ListLinePlot[{list}, ImageSize -> Large, Axes -> False]], 0.5]]) // Colorize listareas = {area1 = 1/. ComponentMeasurements[{mnorm, imgnorm}, "Area"], area2 = 2/. ComponentMeasurements[{mnorm, imgnorm}, "Area"]} 

It works fine, however it is not precise enough for what I need to do because part of the area is taken by the black line.

The list is quite big and the points don't form a polygon.

Any help would be appreciated, thank you in advance.