1 %>@ingroup graphicsapi idata
3 %> @brief Draws hachure
5 %> This hachure typically represents confidence intervals, prediction intervals, or standard deviations.
7 %> The hachures interfere with the line width of the axes and legend border - weird but
this is a MATLAB
's problem
10 %> @param intervals must be a [2]x[number of points] vector with one interval in each column, where the first element is the lower value
12 function draw_hachure2(xaxis, intervals, color)
15 % Some tolerance in the shape of the inputs
16 xaxis = xaxis(:)'; % Makes sure xaxis is a row vector
19 if size(intervals, 1) ~= 2
20 irerror(
'"intervals" must be a 2-row vector!');
23 if intervals(1, 1) > intervals(2, 1)
24 irerror('First row of "intervals" must contain the lower values!');
27 xx = [xaxis, xaxis(end:-1:1)];
28 yy = [intervals(1, :), intervals(2, end:-1:1)];
29 fill(xx, yy, color, 'LineStyle', '-', 'FaceAlpha', 0.25, 'EdgeColor', color, 'LineWidth',
scaled(1), 'EdgeAlpha', 0.8);