graphics.praat 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # graphics.praat
  2. # Paul Boersma, 5 January 2012
  3. Erase all
  4. Times
  5. 14
  6. Select inner viewport... 0.1 0.4 0.1 8.9
  7. Axes... 0 1 0 1
  8. for i from 0 to 800
  9. grey = i/800
  10. Paint rectangle... 'grey' 0 1 i/801 (i+1)/801
  11. endfor
  12. Black
  13. Draw inner box
  14. Select inner viewport... 5.6 5.9 0.1 8.9
  15. Axes... 0 1 18 -1
  16. Line width... 1
  17. Draw line... 0.3 -1 0.3 18
  18. Line width... 2
  19. Draw line... 0.5 -1 0.5 18
  20. Line width... 3
  21. Draw line... 0.7 -1 0.7 18
  22. Line width... 2
  23. Paint rectangle... 0.5 0 3 1 2
  24. drawColour.y = 0
  25. procedure drawColour colour$
  26. Paint rectangle... 'colour$' 0 1 .y .y+1
  27. 'colour$'
  28. Draw line... 1.2 .y 1.1 .y+1
  29. Text... 1.2 left .y+0.5 half 'colour$'
  30. .y += 1
  31. endproc
  32. call drawColour Black
  33. call drawColour White
  34. call drawColour Red
  35. call drawColour Green
  36. call drawColour Blue
  37. call drawColour Yellow
  38. call drawColour Cyan
  39. call drawColour Magenta
  40. call drawColour Maroon
  41. call drawColour Lime
  42. call drawColour Navy
  43. call drawColour Teal
  44. call drawColour Purple
  45. call drawColour Olive
  46. call drawColour Pink
  47. call drawColour Silver
  48. call drawColour Grey
  49. Black
  50. Line width... 1
  51. Select inner viewport... 0.6 1 0.1 1.9
  52. Axes... 0 1 0 1
  53. Draw line... 0 0 0 1
  54. Text... 0 Left 1.0 Top top-aligned
  55. Text... 0 Left 0.8 Half This text here is
  56. Text... 0 Left 0.6 Half left-aligned text
  57. Text... 0 Left 0.4 Half \ae\:fnd\0v \dh\0v\ics \swz w\ef\l~.
  58. Text... 0 Left 0.2 Half many----hyphens
  59. Text... 0 Left 0.0 Bottom bottom-aligned
  60. Text... 0 Left -0.2 Bottom Kate\r<ina
  61. Text... 0 Left -0.4 Bottom Kateřina
  62. Text... 0 Left -0.6 Bottom 한국
  63. Select inner viewport... 2.8 3.2 0.1 1.9
  64. Dotted line
  65. Draw line... 0.5 0 0.5 1
  66. Solid line
  67. Text... 0.5 Centre 1.0 Top top-aligned
  68. Text... 0.5 Centre 0.8 Half This text here is
  69. Text... 0.5 Centre 0.6 Half centred text
  70. Text... 0.5 Centre 0.4 Half \aeːnd\0v \dh\ics \swz w\ef\l~.
  71. Text... 0.5 Centre 0.2 Half many----hyphens
  72. Text... 0.5 Centre 0.0 Bottom bottom-aligned
  73. Select inner viewport... 5 5.4 0.1 1.9
  74. Draw line... 1 0 1 1
  75. Text... 1 Right 1.0 Top top-aligned
  76. Text... 1 Right 0.8 Half This text here is
  77. Text... 1 Right 0.6 Half right-aligned text
  78. Text... 1 Right 0.4 Half \aeːnd\0v \dh\ics \swz w\ef\l~.
  79. Text... 1 Right 0.2 Half many----hyphens
  80. Text... 1 Right 0.0 Bottom bottom-aligned
  81. Text... 1 Right -0.2 Bottom arkadaş
  82. Text... 1 Right -0.4 Bottom aحبيبa
  83. Text... 1 Right -0.6 Bottom 日本
  84. Select inner viewport... 2.5 3.5 2.6 3.6
  85. for i to 10
  86. Draw circle (mm)... 0.5 0.5 i
  87. endfor
  88. Blue
  89. for i to 36
  90. .x = cos (i * pi / 18)
  91. .y = sin (i * pi / 18)
  92. Draw arrow... 0.5+0.3*.x 0.5+0.3*.y 0.5+0.7*.x 0.5+0.7*.y
  93. endfor
  94. for i from 10 to 20
  95. Draw ellipse... 0.5-i/10 0.5+i/10 -0.3 1.3
  96. endfor
  97. Select inner viewport... 0 6 4 5
  98. for i to 10
  99. Paint circle (mm)... green i/12 0.7 i
  100. Paint ellipse... pink (11.9-i)/12 (11.1-i)/12 0.3-i/30 0.3+i/30
  101. endfor
  102. Select outer viewport... 0 6 5 5.5
  103. Text bottom... yes a𝄐𝄑a
  104. Select outer viewport... 0 6 5.5 6
  105. Text bottom... yes VAVAVAVAVAVAVAVAVAVA%%kerning?
  106. Select inner viewport... 0 6 5 6
  107. Purple
  108. Draw rounded rectangle... 0.2 0.4 0.3 0.7 3
  109. Paint rounded rectangle... purple 0.6 0.8 0.3 0.7 3
  110. Select inner viewport... 0 6 6 7
  111. call drawLines 1 0.1
  112. call drawLines 2 0.3
  113. call drawLines 3 0.5
  114. call drawLines 5 0.7
  115. procedure drawLines .width .x
  116. Line width... .width
  117. Dashed line
  118. Draw line... .x 0.65 .x+0.1 0.65
  119. Dotted line
  120. Draw line... .x 0.55 .x+0.1 0.55
  121. Dashed-dotted line
  122. Draw line... .x 0.45 .x+0.1 0.45
  123. Solid line
  124. Draw line... .x 0.35 .x+0.1 0.35
  125. endproc
  126. Line width... 1
  127. Select inner viewport... 0.7 2.7 7 9
  128. Create simple Matrix... hundred 2 100 randomUniform(0,100)
  129. To Polygon
  130. Salesperson... 1000
  131. Draw closed... 0 0 0 0
  132. Create simple Matrix... circle 2 100000
  133. ... if row=1 then cos(2*pi*col/100000) else sin(2*pi*col/100000) fi
  134. To Polygon
  135. Draw... 0 0 0 0
  136. Black
  137. Create simple Matrix... checker 10 10 x*y
  138. Select inner viewport... 3.3 5.3 7 9
  139. Paint cells... 0 0 0 0 0 0
  140. Insert picture from file... paul.png 10 12 10 12
  141. Select outer viewport... 0 6.5 0 9
  142. ;exit
  143. Save as praat picture file... kanweg.prapic
  144. Erase all
  145. Read from praat picture file... kanweg.prapic
  146. deleteFile ("kanweg.prapic")
  147. removeObject: "Matrix hundred", "Polygon hundred", "Matrix circle", "Polygon circle", "Matrix checker"