Mercurial > hg > simscene-py
changeset 22:06e845616cae
fix visualization
author | gregoire lafay <gregoirelafay@sfr.fr> |
---|---|
date | Thu, 14 Jan 2016 21:17:11 +0100 |
parents | e26be576f241 |
children | 0163f857f13f |
files | nonExposed/analyseBaseLineDev.m nonExposed/pianoRollVisualization.m |
diffstat | 2 files changed, 44 insertions(+), 67 deletions(-) [+] |
line wrap: on
line diff
--- a/nonExposed/analyseBaseLineDev.m Thu Jan 14 06:54:31 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -load ~/Téléchargements/results.mat - - -val{1}=[10 30 50]; -val{2}=[0 6 12]; -val{3}=[0 1]; - -for jj=1:length(val{1}) - indMs(jj,:)=cellfun(@(x) ~isempty(strfind(x,['meanSpace_' num2str(val{1}(jj))])),filenames); -end -for jj=1:length(val{2}) - indEbr(jj,:)=cellfun(@(x) ~isempty(strfind(x,['ebr_' num2str(val{2}(jj))])),filenames); -end -for jj=1:length(val{3}) - indOvlp=cellfun(@(x) ~isempty(strfind(x,'ovlp_1')),filenames); -end - -[~,indBestTresh]=max(max(F,[],1)); - -figure(1) -subplot 221 -plot(F(indOvlp & indMs(1,:),indBestTresh),'-*') -hold on -plot(F(indOvlp & indMs(2,:),indBestTresh),'-r*') -plot(F(indOvlp & indMs(3,:),indBestTresh),'-y*') -hold off -ylim([0 0.6]) -ylabel('F') -title('polyphonic') -set(gca,'xtick',1:3,'xticklabel',val{2},'box','off') -xlabel('EBR') -subplot 222 -plot(F(~indOvlp & indMs(1,:),indBestTresh),'-*') -hold on -plot(F(~indOvlp & indMs(2,:),indBestTresh),'-r*') -plot(F(~indOvlp & indMs(3,:),indBestTresh),'-y*') -hold off -title('monophonic') -set(gca,'xtick',1:3,'xticklabel',val{2},'box','off') -ylim([0 0.6]) -xlabel('EBR') -ylabel('F') - -subplot 223 -plot(Feb(indOvlp & indMs(1,:),indBestTresh),'-*') -hold on -plot(Feb(indOvlp & indMs(2,:),indBestTresh),'-r*') -plot(Feb(indOvlp & indMs(3,:),indBestTresh),'-y*') -hold off -ylim([0 0.3]) -ylabel('Feb') -title('polyphonic') -set(gca,'xtick',1:3,'xticklabel',val{2},'box','off') -xlabel('EBR') -subplot 224 -plot(Feb(~indOvlp & indMs(1,:),indBestTresh),'-*') -hold on -plot(Feb(~indOvlp & indMs(2,:),indBestTresh),'-r*') -plot(Feb(~indOvlp & indMs(3,:),indBestTresh),'-y*') -hold off -title('monophonic') -set(gca,'xtick',1:3,'xticklabel',val{2},'box','off') -ylim([0 0.3]) -xlabel('EBR') -ylabel('Feb') -legend(arrayfun(@(x) ['meanSpace ' num2str(x)],val{1},'UniformOutput',false)) -disp('') \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nonExposed/pianoRollVisualization.m Thu Jan 14 21:17:11 2016 +0100 @@ -0,0 +1,44 @@ +function [] = pianoRollVisualization(sceneObjects,sceneSchedule,score,figNum,settingFigure,figuresOption,fileName) + + +%% Producing a "piano roll" visualization + +switch figuresOption + case 1 + f=figure('Visible', 'off'); + case 2 + f=figure(figNum); +end +clf; +grid on; + +for i=1:length(sceneObjects) + text(0, i+.4, [num2str(sceneObjects(i).classLabel), ' '], 'HorizontalAlignment', 'right'); +end + +for i=1:length(sceneSchedule) + id = sceneSchedule(i).classId; + if (sceneSchedule(i).isBackground) + rectangle('Position', [0, id+.2, score.sceneDuration, .6], 'FaceColor', settingFigure.cmap(id,:)); + else + t1 = sceneSchedule(i).position; + rectangle('Position', [t1, id+.1, sceneSchedule(i).duration, .8], 'FaceColor', settingFigure.cmap(id,:)); + end +end + +xlim([0 score.sceneDuration]) +set(gca,'YTick', [],'YTicklabel', [],'xtick',0:20:score.sceneDuration); +xlabel('time (sec)') + + +set(f,'PaperUnits','centimeters') +set(f,'PaperPositionMode','manual') +set(f,'papersize',[settingFigure.width,settingFigure.height]) +set(f,'paperposition',[0,0,settingFigure.width,settingFigure.height]) +set(findall(f,'-property','FontSize'),'FontSize',settingFigure.FontSize) +set(findall(f,'-property','FontName'),'FontName','Arial') + +print(f,fileName,'-dpng') + +end +