function makeplots(noscore_mode,filemask);
%filemask='refdata_matdata_image_*.mat';
%filemask='refdata_matdata_video_*.mat';

fList=dir(filemask);
nFile=length(fList);



for iFile=1:nFile,
    load(fList(iFile).name);
    %matdata(iR,icoder,nmetrics+1,counter)
    matdata_users(iFile,:,:,:,:)=matdata;
end
single_user_mode=0;
if nFile==1
    matdata_users(2,:,:,:,:)=matdata;
    single_user_mode=1;
end

nR=size(matdata_users,2);
nC=size(matdata_users,3);
nM=size(matdata_users,4)-2;

colors={'r','g','b','y','k'};
if noscore_mode
    num_total_plots=nM;
    sN=2;
    sM=ceil(num_total_plots/sN);
else
    num_total_plots=2*nM+1;
    sN=2;
    sM=ceil(num_total_plots/sN);
end


for iR=1:nR,
    figure;
    for iC=1:nC
        for iN=1:nM
            subplot(sM,sN,iN),
            title(refdata(iR).name);
            plot(squeeze(matdata_users(1,iR,iC,end,:)),...
                squeeze(matdata_users(1,iR,iC,iN,:)),sprintf('%s*-',colors{iC}),'linewidth',2);
            hold on;
            legend( refdata(iR).coder(:).name);
            xlabel('Filesize');
            % TODO : metric name!
            ylabel(refdata(iR).coder(iC).metricname{iN});
            
            if ~noscore_mode
                
                subplot(sM,sN,iN+nM),
                metric=squeeze(matdata_users(1,iR,iC,iN,:));
                score=squeeze(matdata_users(:,iR,iC,end-1,:));
                meanscore=mean(score,1);
                if ~single_user_mode
                    stdscore=std(score,0,1);
                else
                    stdscore=0.1;
                end
                fsize=squeeze(matdata_users(1,iR,iC,end,:));
                ciplot(meanscore-stdscore,meanscore+stdscore,metric,...
                    colors{iC});
                hold on;
                legend( refdata(iR).coder(:).name);
                xlabel(refdata(iR).coder(iC).metricname{iN});
                ylabel('Score');
                subplot(sM,sN,2*nM+1),
                ciplot(meanscore-stdscore,meanscore+stdscore,fsize,...
                    colors{iC});
                hold on;
                %legend( refdata(iR).coder(:).name);
                xlabel('Filesize');
                ylabel('Score');
            end
        end
    end
end