Mercurial > hg > simscene-py
comparison nonExposed/pianoRollVisualization.m @ 22:06e845616cae
fix visualization
author | gregoire lafay <gregoirelafay@sfr.fr> |
---|---|
date | Thu, 14 Jan 2016 21:17:11 +0100 |
parents | |
children | 39399de892ef |
comparison
equal
deleted
inserted
replaced
21:e26be576f241 | 22:06e845616cae |
---|---|
1 function [] = pianoRollVisualization(sceneObjects,sceneSchedule,score,figNum,settingFigure,figuresOption,fileName) | |
2 | |
3 | |
4 %% Producing a "piano roll" visualization | |
5 | |
6 switch figuresOption | |
7 case 1 | |
8 f=figure('Visible', 'off'); | |
9 case 2 | |
10 f=figure(figNum); | |
11 end | |
12 clf; | |
13 grid on; | |
14 | |
15 for i=1:length(sceneObjects) | |
16 text(0, i+.4, [num2str(sceneObjects(i).classLabel), ' '], 'HorizontalAlignment', 'right'); | |
17 end | |
18 | |
19 for i=1:length(sceneSchedule) | |
20 id = sceneSchedule(i).classId; | |
21 if (sceneSchedule(i).isBackground) | |
22 rectangle('Position', [0, id+.2, score.sceneDuration, .6], 'FaceColor', settingFigure.cmap(id,:)); | |
23 else | |
24 t1 = sceneSchedule(i).position; | |
25 rectangle('Position', [t1, id+.1, sceneSchedule(i).duration, .8], 'FaceColor', settingFigure.cmap(id,:)); | |
26 end | |
27 end | |
28 | |
29 xlim([0 score.sceneDuration]) | |
30 set(gca,'YTick', [],'YTicklabel', [],'xtick',0:20:score.sceneDuration); | |
31 xlabel('time (sec)') | |
32 | |
33 | |
34 set(f,'PaperUnits','centimeters') | |
35 set(f,'PaperPositionMode','manual') | |
36 set(f,'papersize',[settingFigure.width,settingFigure.height]) | |
37 set(f,'paperposition',[0,0,settingFigure.width,settingFigure.height]) | |
38 set(findall(f,'-property','FontSize'),'FontSize',settingFigure.FontSize) | |
39 set(findall(f,'-property','FontName'),'FontName','Arial') | |
40 | |
41 print(f,fileName,'-dpng') | |
42 | |
43 end | |
44 |