I have a discrete signal. How can I calculate the area under the curve for $2\le x \le 4$? How can I fill the same area in the plot generated by SmoothHistogram
?
For Example:
r5 = RandomReal[NormalDistribution[1, 2], 100]
p100x = SmoothHistogram[r5, 0.1, "PDF", Frame -> True, FrameLabel -> {{"\!\(\*SubscriptBox[\(P\), \(100\)]\)(x)",}, {"R, \ Ohm",}}, FrameTicks -> Automatic, PlotRange -> {{All, All}, {All, All}}, GridLines -> Automatic, ImageSize -> 600, PlotLegends -> legend, ScalingFunctions -> {None, "Log"}]
NIntegrate
? you might also want to remove the non-essential formatting options in your code. They don't matter much for your problem, and clutter the code. $\endgroup$SmoothHistogram
? If so, do you want the area under the curve with the original values or the log of the values? The total area under aSmoothHistogram
using thePDF
option is exactly 1. Does that match to the "discrete signal" data? $\endgroup$