function randomBoxPlot(path, pattern, logbased, points)

labels = [];

files = dir(path);
datapoints = [];

% get matching files of the specified pattern (should be .parts files)
for i = 1: numel(files)    
    currfile = files(i).name;
    if numel(regexp(currfile, pattern)) > 0
        currfile
        currpath = fullfile(path, currfile);
      
        % get the mean and spread of the file
        currrows = loadSummary(currpath, points);
        
        % collect the spread information
        currdata = zeros(1, size(currrows,2)/2);
        labels = zeros(1,  size(currrows,2)/2);
        for j = 1:size(currrows, 2)
            if mod(j,2) == 0
                currdata(1, j/2) = currrows(2, j);
                labels(1, j/2) = currrows(1, j);
            end
        end
        datapoints = [datapoints; currdata];
    end
end

logdata = loadSummary(logbased, points);
logspread = zeros(1, size(logdata,2)/2);
for i = 1:numel(logspread)
    logspread(1,i) = logdata(2, i*2);
end

% Create figure
%figure1 = figure('Position', [1500, 300, 600, 350]);
figure1 = figure('Position', [1500, 300, 350, 250]);

% Create axes
axes1 = axes('Parent',figure1);
box(axes1,'on');
hold(axes1,'all');
datapoints
boxplot(axes1, datapoints, 'labels', labels, 'whisker', 10000);
plot(axes1, logspread, 'o-', 'DisplayName', 'Log-based');
ylim(axes1,[0 0.5]);

%plot(mean(datapoints), 'd', 'Parent', axes1);

% Create legend
legend(axes1,'show');

% Create xlabel
xlabel({'Query Arrival Rate (queries/sec)'});

% Create ylabel
ylabel({'Load Spread'});

end