#! Praat script p2/simulation/drawCategorization.praat # Paul Boersma, September 26, 2001 form Draw categorization choice Which: 2 button Baby button Elspeth button Liz button Isabel button Carmen integer Time 100 endform width = 5.0 height = 4.1 if which$ = "Baby" Read from file... baby.Matrix elsif which$ = "Elspeth" Read from file... elspeth'time'.Matrix elsif which$ = "Liz" Read from file... liz'time'.Matrix elsif which$ = "Isabel" Read from file... isabel'time'.Matrix elsif which$ = "Carmen" Read from file... carmen'time'.Matrix endif id = selected ("Matrix") matrix$ = selected$ ("Matrix") nrow = Get number of rows ncol = Get number of columns horizontalReliance = 0 verticalReliance = 0 for row to nrow left = Get value in cell... row 1 right = Get value in cell... row ncol horizontalReliance = horizontalReliance + right - left endfor for col to ncol bottom = Get value in cell... 1 col top = Get value in cell... nrow col verticalReliance = verticalReliance + top - bottom endfor horizontalReliance = horizontalReliance / 1000 / nrow verticalReliance = - verticalReliance / 1000 / ncol horizontalReliance$ = fixed$ (100 * horizontalReliance, 1) verticalReliance$ = fixed$ (100 * verticalReliance, 1) Copy... dummy select 'id' Formula... Matrix_dummy [nrow + 1 - row, col] Erase all Times Font size... 24 Viewport... 0 width 0 height Paint contours... log2(50)-1e-12 log2(120)+1e-12 ... log2(260)-1e-12 log2(500)+1e-12 0 1000 Draw one contour... log2(50)-1e-12 log2(120)+1e-12 ... log2(260)-1e-12 log2(500)+1e-12 500 Axes... log2(50) log2(120) -log2(500) -log2(260) One mark left... -log2(260) no yes no 260 One mark left... -log2(300) no yes no 300 One mark left... -log2(400) no yes no 400 One mark left... -log2(500) no yes no 500 One mark bottom... log2(50) no yes no 50 One mark bottom... log2(70) no yes no 70 One mark bottom... log2(90) no yes no 90 One mark bottom... log2(120) no yes no 120 Draw inner box Viewport... 0 width 0.05 height Text top... no dur.rel. 'horizontalReliance$'\% Viewport... 0 width 0 height Text right... no spec.rel. 'verticalReliance$'\% Viewport... 0.7 width-0.9 0.4 height-0.4