%%
figure
axes

s = round(10.^(1:.25:6));
n = numel(s);

% Loop over the charting functions
funcs = {'area'};
results.count = s;
for i=1:numel(funcs)
    disp(funcs{i})
    rng(0)
    % Loop over the different sizes
    t = nan(1,n);
    for j=1:n
        np = s(j);        
        x = 1:np;
        d = rand(1,np);
        % Do multiple passes to eliminate noisy results
        raw = [];
        for k=1:35
            cla;
            drawnow;
            f = str2func(funcs{i});
            tic
            f(x,d);
            drawnow;   
            dt = toc;
            raw = [raw, dt];
            % If we've taken more than 15 seconds, just skip to the next one
            if sum(raw) > 15
                disp(['skipping at ', num2str(k)])
                break
            end
        end
        % Save the median of the raw data
        t(j) = median(raw);
        % If a single chart took more than 15 seconds, just quit
        if t(j) > 15
            disp(['quitting at ', num2str(np)])
            break
        end
    end
    results.(funcs{i}) = t;
end

disp Complete