diff --git a/MOT Capture Process Simulation/+Plotting/plotConfidenceIntervalRegion.m b/MOT Capture Process Simulation/+Plotting/plotConfidenceIntervalRegion.m new file mode 100644 index 0000000..2769798 --- /dev/null +++ b/MOT Capture Process Simulation/+Plotting/plotConfidenceIntervalRegion.m @@ -0,0 +1,18 @@ +function plotConfidenceIntervalRegion(x, y1, y2) + % draws two lines on a plot and shades the area between those + % lines to indicate confidence interval. + hold on + + X_interpolated = linspace(min(x), max(x), 100); + Y1_interpolated = interp1(x,y1,X_interpolated); + Y2_interpolated = interp1(x,y2,X_interpolated); + + %Plot the line edges + %plot(X_interpolated, Y1_interpolated, 'LineWidth', 0.5, 'LineStyle', '--', 'Color', '#FE1A1A'); + %plot(X_interpolated, Y2_interpolated, 'LineWidth', 0.5, 'LineStyle', '--', 'Color', '#FE1A1A'); + + fill([X_interpolated fliplr(X_interpolated)], [Y1_interpolated fliplr(Y2_interpolated)], [0 71 138] ./ 255, 'EdgeColor', 'none', 'FaceAlpha', 0.2); + + hold off +end + \ No newline at end of file