plot-io 0.3.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. {plot_io-0.3.0 → plot_io-0.6.0}/API.md +1308 -482
  2. {plot_io-0.3.0 → plot_io-0.6.0}/EXAMPLES.md +105 -38
  3. {plot_io-0.3.0 → plot_io-0.6.0}/PKG-INFO +42 -10
  4. {plot_io-0.3.0 → plot_io-0.6.0}/README.md +38 -7
  5. {plot_io-0.3.0 → plot_io-0.6.0}/examples/annotated.py +1 -1
  6. {plot_io-0.3.0 → plot_io-0.6.0}/examples/bars.py +5 -5
  7. {plot_io-0.3.0 → plot_io-0.6.0}/examples/box_plots.py +1 -1
  8. {plot_io-0.3.0 → plot_io-0.6.0}/examples/density.py +4 -4
  9. {plot_io-0.3.0 → plot_io-0.6.0}/examples/distributions.py +3 -3
  10. {plot_io-0.3.0 → plot_io-0.6.0}/examples/facets.py +3 -3
  11. plot_io-0.6.0/examples/genome_tracks.py +70 -0
  12. {plot_io-0.3.0 → plot_io-0.6.0}/examples/grids2d.py +4 -4
  13. {plot_io-0.3.0 → plot_io-0.6.0}/examples/groups.py +2 -2
  14. plot_io-0.6.0/examples/heatmap.py +16 -0
  15. {plot_io-0.3.0 → plot_io-0.6.0}/examples/layouts.py +1 -1
  16. {plot_io-0.3.0 → plot_io-0.6.0}/examples/scales.py +1 -1
  17. {plot_io-0.3.0 → plot_io-0.6.0}/examples/scatter_groups.py +1 -2
  18. {plot_io-0.3.0 → plot_io-0.6.0}/examples/shared_colorbar.py +4 -4
  19. plot_io-0.6.0/examples/shared_sizes.py +29 -0
  20. {plot_io-0.3.0 → plot_io-0.6.0}/examples/time_twin.py +1 -1
  21. {plot_io-0.3.0 → plot_io-0.6.0}/examples/units.py +1 -1
  22. {plot_io-0.3.0 → plot_io-0.6.0}/examples/variable_fonts.py +2 -2
  23. plot_io-0.6.0/plot_io/__init__.py +57 -0
  24. plot_io-0.6.0/plot_io/_backend.py +43 -0
  25. plot_io-0.6.0/plot_io/_native/README.md +96 -0
  26. plot_io-0.6.0/plot_io/_native/__init__.py +188 -0
  27. plot_io-0.6.0/plot_io/_native/_api.py +365 -0
  28. plot_io-0.6.0/plot_io/_native/bin/linux-aarch64.so +0 -0
  29. plot_io-0.6.0/plot_io/_native/bin/linux-x86_64.so +0 -0
  30. plot_io-0.6.0/plot_io/_native/bin/macos-arm64.dylib +0 -0
  31. plot_io-0.6.0/plot_io/_native/bin/windows-arm64.dll +0 -0
  32. plot_io-0.6.0/plot_io/_native/bin/windows-x86_64.dll +0 -0
  33. plot_io-0.6.0/plot_io/_native/kernels.py +326 -0
  34. plot_io-0.6.0/plot_io/_native/manifest.json +49 -0
  35. plot_io-0.6.0/plot_io/_native/src/alloc.c +163 -0
  36. plot_io-0.6.0/plot_io/_native/src/colormap.c +205 -0
  37. plot_io-0.6.0/plot_io/_native/src/data.c +47 -0
  38. plot_io-0.6.0/plot_io/_native/src/math.c +359 -0
  39. plot_io-0.6.0/plot_io/_native/src/plio.h +126 -0
  40. plot_io-0.6.0/plot_io/_native/src/plio_api.h +246 -0
  41. plot_io-0.6.0/plot_io/_native/src/plot.c +1679 -0
  42. plot_io-0.6.0/plot_io/_native/src/rt.c +104 -0
  43. plot_io-0.6.0/plot_io/_native/src/signatures.c +267 -0
  44. plot_io-0.6.0/plot_io/_native/src/stats.c +671 -0
  45. plot_io-0.6.0/plot_io/_threads.py +43 -0
  46. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/axis.py +275 -95
  47. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/color/__init__.py +1 -1
  48. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/color/data.py +13 -9
  49. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/color/maps.py +118 -35
  50. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/color/palettes.py +10 -9
  51. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/color/values.py +45 -12
  52. plot_io-0.6.0/plot_io/colorbar.py +451 -0
  53. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/decorations.py +31 -28
  54. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/defaults.py +197 -198
  55. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/density.py +8 -8
  56. plot_io-0.6.0/plot_io/facets.py +202 -0
  57. plot_io-0.6.0/plot_io/figure.py +560 -0
  58. plot_io-0.6.0/plot_io/genome/__init__.py +11 -0
  59. plot_io-0.6.0/plot_io/genome/layout.py +136 -0
  60. plot_io-0.6.0/plot_io/genome/pack.py +23 -0
  61. plot_io-0.6.0/plot_io/genome/regions.py +127 -0
  62. plot_io-0.6.0/plot_io/genome/scale.py +137 -0
  63. plot_io-0.6.0/plot_io/genome/sources.py +299 -0
  64. plot_io-0.6.0/plot_io/genome/tracks.py +1253 -0
  65. plot_io-0.6.0/plot_io/geometry.py +222 -0
  66. plot_io-0.6.0/plot_io/groups.py +285 -0
  67. plot_io-0.6.0/plot_io/kernels.py +551 -0
  68. plot_io-0.6.0/plot_io/labels.py +70 -0
  69. plot_io-0.6.0/plot_io/layers/__init__.py +66 -0
  70. plot_io-0.6.0/plot_io/layers/base.py +387 -0
  71. plot_io-0.6.0/plot_io/layers/context.py +72 -0
  72. plot_io-0.6.0/plot_io/layers/core.py +274 -0
  73. plot_io-0.6.0/plot_io/layers/geoms.py +1206 -0
  74. plot_io-0.3.0/plot_io/series/points.py → plot_io-0.6.0/plot_io/layers/paint.py +167 -133
  75. plot_io-0.6.0/plot_io/layers/pipeline.py +91 -0
  76. plot_io-0.6.0/plot_io/layers/positions.py +238 -0
  77. plot_io-0.6.0/plot_io/layers/stats.py +442 -0
  78. plot_io-0.6.0/plot_io/layout.py +1161 -0
  79. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/legend.py +194 -153
  80. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/limits.py +2 -0
  81. plot_io-0.6.0/plot_io/mapped.py +456 -0
  82. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/markers.py +7 -7
  83. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/numbers.py +4 -23
  84. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/occupancy.py +3 -2
  85. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/plot.py +58 -149
  86. plot_io-0.6.0/plot_io/presets/__init__.py +42 -0
  87. plot_io-0.6.0/plot_io/presets/_util.py +260 -0
  88. {plot_io-0.3.0/plot_io/series → plot_io-0.6.0/plot_io/presets}/area.py +78 -83
  89. plot_io-0.6.0/plot_io/presets/bar.py +257 -0
  90. plot_io-0.6.0/plot_io/presets/box.py +382 -0
  91. plot_io-0.6.0/plot_io/presets/catpoints.py +174 -0
  92. plot_io-0.6.0/plot_io/presets/contour.py +303 -0
  93. plot_io-0.6.0/plot_io/presets/curves.py +30 -0
  94. plot_io-0.6.0/plot_io/presets/ecdf.py +97 -0
  95. plot_io-0.6.0/plot_io/presets/errorbar.py +119 -0
  96. {plot_io-0.3.0/plot_io/series → plot_io-0.6.0/plot_io/presets}/errors.py +65 -38
  97. plot_io-0.6.0/plot_io/presets/fill.py +94 -0
  98. plot_io-0.6.0/plot_io/presets/heatmap.py +289 -0
  99. plot_io-0.6.0/plot_io/presets/hexbin.py +183 -0
  100. plot_io-0.6.0/plot_io/presets/hist.py +360 -0
  101. plot_io-0.6.0/plot_io/presets/hist2d.py +78 -0
  102. plot_io-0.6.0/plot_io/presets/kde.py +166 -0
  103. plot_io-0.6.0/plot_io/presets/kde2d.py +126 -0
  104. plot_io-0.6.0/plot_io/presets/line.py +154 -0
  105. plot_io-0.6.0/plot_io/presets/pie.py +457 -0
  106. plot_io-0.6.0/plot_io/presets/regression.py +120 -0
  107. plot_io-0.6.0/plot_io/presets/scatter.py +125 -0
  108. plot_io-0.6.0/plot_io/presets/stem.py +96 -0
  109. plot_io-0.6.0/plot_io/presets/violin.py +301 -0
  110. plot_io-0.6.0/plot_io/py.typed +0 -0
  111. plot_io-0.6.0/plot_io/render.py +332 -0
  112. plot_io-0.6.0/plot_io/rows.py +399 -0
  113. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/scales.py +7 -6
  114. plot_io-0.6.0/plot_io/seams.py +119 -0
  115. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/settings.py +250 -121
  116. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/shapes.py +16 -8
  117. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/sharing.py +57 -20
  118. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/sizemaps.py +15 -18
  119. plot_io-0.6.0/plot_io/spec.py +202 -0
  120. plot_io-0.6.0/plot_io/states.py +176 -0
  121. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/stats.py +19 -21
  122. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/styles/__init__.py +53 -26
  123. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/styles/library.py +71 -29
  124. plot_io-0.6.0/plot_io/text.py +222 -0
  125. plot_io-0.6.0/plot_io/transform.py +108 -0
  126. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/units.py +94 -38
  127. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/values.py +2 -3
  128. plot_io-0.6.0/pyproject.toml +40 -0
  129. plot_io-0.6.0/tests/fonts/PioTest-Bold.ttf +0 -0
  130. plot_io-0.6.0/tests/fonts/PioTest-Regular.ttf +0 -0
  131. plot_io-0.6.0/tests/golden.json +111 -0
  132. plot_io-0.6.0/tests/helpers.py +98 -0
  133. plot_io-0.6.0/tests/stats_reference.json +839 -0
  134. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_bars.py +117 -12
  135. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_box.py +11 -7
  136. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_decorations.py +48 -5
  137. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_defaults.py +44 -20
  138. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_density.py +79 -28
  139. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_distributions.py +13 -9
  140. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_entry.py +20 -4
  141. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_figure_title.py +3 -3
  142. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_fonts.py +2 -1
  143. plot_io-0.6.0/tests/test_genome.py +839 -0
  144. plot_io-0.6.0/tests/test_geometry.py +368 -0
  145. plot_io-0.6.0/tests/test_golden.py +186 -0
  146. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_grids.py +7 -6
  147. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_heatmap.py +16 -9
  148. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_jxl_output.py +6 -5
  149. plot_io-0.6.0/tests/test_layers.py +149 -0
  150. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_layout.py +22 -22
  151. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_limits.py +3 -1
  152. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_maps.py +79 -29
  153. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_markers.py +6 -4
  154. plot_io-0.6.0/tests/test_native.py +94 -0
  155. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_numbers.py +1 -1
  156. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_occupancy.py +12 -12
  157. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_output.py +56 -12
  158. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_palettes.py +4 -4
  159. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_pie.py +2 -2
  160. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_reflines.py +3 -3
  161. plot_io-0.6.0/tests/test_rows.py +138 -0
  162. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_series.py +15 -18
  163. plot_io-0.6.0/tests/test_settings.py +237 -0
  164. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_sharing.py +5 -2
  165. plot_io-0.6.0/tests/test_simplify.py +88 -0
  166. plot_io-0.6.0/tests/test_stats.py +98 -0
  167. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_style_settings.py +32 -15
  168. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_style_types.py +1 -0
  169. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_styles.py +13 -12
  170. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_tables.py +108 -11
  171. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_ticks.py +1 -0
  172. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_time_twin.py +3 -3
  173. plot_io-0.6.0/tests/test_transform.py +101 -0
  174. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_units.py +26 -12
  175. plot_io-0.6.0/tests/test_values.py +351 -0
  176. plot_io-0.6.0/tests/test_vocabulary.py +130 -0
  177. plot_io-0.6.0/tools/build_native.py +640 -0
  178. {plot_io-0.3.0 → plot_io-0.6.0}/tools/settings_doc.py +81 -15
  179. plot_io-0.3.0/.gitignore +0 -19
  180. plot_io-0.3.0/examples/annotated.png +0 -0
  181. plot_io-0.3.0/examples/bars.png +0 -0
  182. plot_io-0.3.0/examples/box_plots.png +0 -0
  183. plot_io-0.3.0/examples/density.png +0 -0
  184. plot_io-0.3.0/examples/distributions.png +0 -0
  185. plot_io-0.3.0/examples/error_bars.png +0 -0
  186. plot_io-0.3.0/examples/facets.png +0 -0
  187. plot_io-0.3.0/examples/grids2d.png +0 -0
  188. plot_io-0.3.0/examples/groups.png +0 -0
  189. plot_io-0.3.0/examples/heatmap.png +0 -0
  190. plot_io-0.3.0/examples/heatmap.py +0 -16
  191. plot_io-0.3.0/examples/large_data.png +0 -0
  192. plot_io-0.3.0/examples/layout_axes.png +0 -0
  193. plot_io-0.3.0/examples/layout_borders.png +0 -0
  194. plot_io-0.3.0/examples/line_band.png +0 -0
  195. plot_io-0.3.0/examples/scales.png +0 -0
  196. plot_io-0.3.0/examples/scatter_groups.png +0 -0
  197. plot_io-0.3.0/examples/shared_colorbar.png +0 -0
  198. plot_io-0.3.0/examples/styles/altair-2.png +0 -0
  199. plot_io-0.3.0/examples/styles/altair.png +0 -0
  200. plot_io-0.3.0/examples/styles/bokeh-2.png +0 -0
  201. plot_io-0.3.0/examples/styles/bokeh.png +0 -0
  202. plot_io-0.3.0/examples/styles/chartjs-2.png +0 -0
  203. plot_io-0.3.0/examples/styles/chartjs.png +0 -0
  204. plot_io-0.3.0/examples/styles/default-2.png +0 -0
  205. plot_io-0.3.0/examples/styles/default.png +0 -0
  206. plot_io-0.3.0/examples/styles/economist-2.png +0 -0
  207. plot_io-0.3.0/examples/styles/economist.png +0 -0
  208. plot_io-0.3.0/examples/styles/excel-2.png +0 -0
  209. plot_io-0.3.0/examples/styles/excel.png +0 -0
  210. plot_io-0.3.0/examples/styles/fivethirtyeight-2.png +0 -0
  211. plot_io-0.3.0/examples/styles/fivethirtyeight.png +0 -0
  212. plot_io-0.3.0/examples/styles/ggplot2-2.png +0 -0
  213. plot_io-0.3.0/examples/styles/ggplot2-bw-2.png +0 -0
  214. plot_io-0.3.0/examples/styles/ggplot2-bw.png +0 -0
  215. plot_io-0.3.0/examples/styles/ggplot2.png +0 -0
  216. plot_io-0.3.0/examples/styles/matlab-2.png +0 -0
  217. plot_io-0.3.0/examples/styles/matlab.png +0 -0
  218. plot_io-0.3.0/examples/styles/matplotlib-2.png +0 -0
  219. plot_io-0.3.0/examples/styles/matplotlib-classic-2.png +0 -0
  220. plot_io-0.3.0/examples/styles/matplotlib-classic.png +0 -0
  221. plot_io-0.3.0/examples/styles/matplotlib.png +0 -0
  222. plot_io-0.3.0/examples/styles/observable-2.png +0 -0
  223. plot_io-0.3.0/examples/styles/observable.png +0 -0
  224. plot_io-0.3.0/examples/styles/plotly-2.png +0 -0
  225. plot_io-0.3.0/examples/styles/plotly-white-2.png +0 -0
  226. plot_io-0.3.0/examples/styles/plotly-white.png +0 -0
  227. plot_io-0.3.0/examples/styles/plotly.png +0 -0
  228. plot_io-0.3.0/examples/styles/seaborn-2.png +0 -0
  229. plot_io-0.3.0/examples/styles/seaborn-whitegrid-2.png +0 -0
  230. plot_io-0.3.0/examples/styles/seaborn-whitegrid.png +0 -0
  231. plot_io-0.3.0/examples/styles/seaborn.png +0 -0
  232. plot_io-0.3.0/examples/styles/tufte-2.png +0 -0
  233. plot_io-0.3.0/examples/styles/tufte.png +0 -0
  234. plot_io-0.3.0/examples/time_twin.png +0 -0
  235. plot_io-0.3.0/examples/units.png +0 -0
  236. plot_io-0.3.0/examples/variable_fonts.png +0 -0
  237. plot_io-0.3.0/plot_io/__init__.py +0 -67
  238. plot_io-0.3.0/plot_io/_backend.py +0 -121
  239. plot_io-0.3.0/plot_io/colorbar.py +0 -364
  240. plot_io-0.3.0/plot_io/enums.py +0 -64
  241. plot_io-0.3.0/plot_io/facets.py +0 -184
  242. plot_io-0.3.0/plot_io/figure.py +0 -376
  243. plot_io-0.3.0/plot_io/labels.py +0 -45
  244. plot_io-0.3.0/plot_io/render.py +0 -1209
  245. plot_io-0.3.0/plot_io/series/__init__.py +0 -526
  246. plot_io-0.3.0/plot_io/series/bar.py +0 -294
  247. plot_io-0.3.0/plot_io/series/box.py +0 -402
  248. plot_io-0.3.0/plot_io/series/catdata.py +0 -23
  249. plot_io-0.3.0/plot_io/series/catpoints.py +0 -185
  250. plot_io-0.3.0/plot_io/series/contour.py +0 -297
  251. plot_io-0.3.0/plot_io/series/curves.py +0 -128
  252. plot_io-0.3.0/plot_io/series/ecdf.py +0 -147
  253. plot_io-0.3.0/plot_io/series/errorbar.py +0 -113
  254. plot_io-0.3.0/plot_io/series/fill.py +0 -170
  255. plot_io-0.3.0/plot_io/series/heatmap.py +0 -297
  256. plot_io-0.3.0/plot_io/series/hexbin.py +0 -220
  257. plot_io-0.3.0/plot_io/series/hist.py +0 -390
  258. plot_io-0.3.0/plot_io/series/hist2d.py +0 -163
  259. plot_io-0.3.0/plot_io/series/kde.py +0 -238
  260. plot_io-0.3.0/plot_io/series/kde2d.py +0 -154
  261. plot_io-0.3.0/plot_io/series/line.py +0 -172
  262. plot_io-0.3.0/plot_io/series/pie.py +0 -324
  263. plot_io-0.3.0/plot_io/series/regression.py +0 -254
  264. plot_io-0.3.0/plot_io/series/scatter.py +0 -104
  265. plot_io-0.3.0/plot_io/series/stem.py +0 -114
  266. plot_io-0.3.0/plot_io/series/violin.py +0 -324
  267. plot_io-0.3.0/plot_io/slots.py +0 -62
  268. plot_io-0.3.0/plot_io/stacking.py +0 -63
  269. plot_io-0.3.0/plot_io/text.py +0 -132
  270. plot_io-0.3.0/pyproject.toml +0 -35
  271. plot_io-0.3.0/tests/golden.json +0 -21
  272. plot_io-0.3.0/tests/helpers.py +0 -17
  273. plot_io-0.3.0/tests/test_golden.py +0 -101
  274. plot_io-0.3.0/tests/test_settings.py +0 -95
  275. plot_io-0.3.0/tests/test_simplify.py +0 -67
  276. plot_io-0.3.0/tests/test_values.py +0 -175
  277. plot_io-0.3.0/tools/bench.py +0 -225
  278. plot_io-0.3.0/tools/dist.py +0 -80
  279. {plot_io-0.3.0 → plot_io-0.6.0}/LICENSE +0 -0
  280. {plot_io-0.3.0 → plot_io-0.6.0}/examples/error_bars.py +0 -0
  281. {plot_io-0.3.0 → plot_io-0.6.0}/examples/large_data.py +0 -0
  282. {plot_io-0.3.0 → plot_io-0.6.0}/examples/line_band.py +0 -0
  283. {plot_io-0.3.0 → plot_io-0.6.0}/examples/styles.py +0 -0
  284. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/lines.py +0 -0
  285. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/tables.py +0 -0
  286. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/ticks.py +0 -0
  287. {plot_io-0.3.0 → plot_io-0.6.0}/plot_io/times.py +0 -0
  288. {plot_io-0.3.0 → plot_io-0.6.0}/tests/fonts/VarTest.ttf +0 -0
  289. {plot_io-0.3.0 → plot_io-0.6.0}/tests/test_docs.py +0 -0
@@ -7,12 +7,13 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
7
7
  3. [Plots](#3-plots)
8
8
  4. [Axes](#4-axes)
9
9
  5. [Series](#5-series)
10
- 6. [Colorbars](#6-colorbars)
10
+ 6. [Color and size axes](#6-color-and-size-axes)
11
11
  7. [Colors, maps and markers](#7-colors-maps-and-markers)
12
12
  8. [Output](#8-output)
13
- 9. [Styles](#9-styles)
14
- 10. [Errors](#10-errors)
15
- 11. [Modules](#11-modules)
13
+ 9. [Genome tracks](#9-genome-tracks)
14
+ 10. [Styles](#10-styles)
15
+ 11. [Errors](#11-errors)
16
+ 12. [Modules](#12-modules)
16
17
 
17
18
  ## 1. Conventions
18
19
 
@@ -28,25 +29,63 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
28
29
  the setting (with the nearest valid name).
29
30
  * **Inheritance.** Settings marked *inherited* in the tables (font, line width, palette,
30
31
  alpha, `rasterize`, `simplify`) are looked up series → plot → figure → style.
31
- * **Defaults.** Every default is in one dict, `plot_io/defaults.py`'s `DEFAULTS`
32
- (`pl.defaults()` returns a copy): bare names for inherited settings (font size,
33
- sans-serif, black text, line width, `simplify="auto"`, the palette, …), and
34
- `"Class.name"` for the settings of each class. A class without an entry uses its base
35
- class's. Entries are plain data: a default that follows another setting is written
36
- with units, `var()` or `calc()` (a legend's font is `"1em"`, a minor tick `"60%"` of the
37
- tick length, a fill's opacity `"calc(0.3 * var(alpha))"`). `None` and `"auto"` mean
38
- "chosen when drawing", as each setting's documentation says. `"XAxis.name"` and
32
+ * **Setting groups.** Settings that travel together are declared once as a group and
33
+ embedded by each owner: `Font` (family, size, variable-font axes), `TextStyle` (size,
34
+ weight, style, color of one text element), `Stroke` (color, width, dash style, caps,
35
+ joins), `Marker`, `FillStyle` (`fill`: on or off, an opacity or a color) and
36
+ `NumberFormat`. The naming rule: an owner's primary element takes a group unprefixed, a
37
+ secondary one prefixed, and every member's prefixed name follows its pattern. A
38
+ scatter's markers are `size`, `edge_color`, …; a line's are `marker_size`,
39
+ `marker_edge_color`; a box's whiskers are `whisker_color`, `whisker_width`,
40
+ `whisker_style`; an axis' tick labels are `tick_label_font_size`, `tick_label_weight`,
41
+ `tick_label_color`. Each table ends with the groups the class embeds and their
42
+ prefixes; [groups](#setting-groups) lists the members.
43
+ * **Defaults.** Every default is in one dict, `pl.DEFAULTS` (`plot_io/defaults.py`; read
44
+ it, do not change it: styles set other values): bare names for inherited settings (font size,
45
+ sans-serif, black text, line width, `simplify="auto"`, the palette, …),
46
+ `"Class.name"` for the settings of each class and `"Group.member"` for every embedding
47
+ of a group member (`"Marker.size"`: every marker size). A class without an entry uses
48
+ its base class's, then the group's. Entries are plain data: a default that follows
49
+ another setting is written with units, `var()` or `calc()` (a legend's font is `"1em"`,
50
+ a minor tick `"60%"` of the tick length), and a class default of an inherited setting
51
+ scales the inherited value with `inherit` (a regression line is
52
+ `"calc(1.4 * inherit)"`, a fill's opacity `"calc(0.3 * inherit)"`). `"XAxis.name"` and
39
53
  `"YAxis.name"` give one axis its own default.
54
+ * **`"auto"`.** A setting whose default is `"auto"` documents its rule. Rules that follow
55
+ from the model (a colorbar's orientation from its position, a legend's inner pad from
56
+ its frame, a genome track's gap) are resolved with the setting: `resolve()` returns the
57
+ result and `get()` `"auto"`. Rules that need the data or the layout (axis limits,
58
+ padding, tick count and rotation, number formats, legend placement) are resolved when
59
+ the figure is drawn.
60
+ * **Resolution.** One cascade finds every value, for `resolve`, `get` and `explain`:
61
+ 1. the value set on the object; for a plot's x or y axis, then the value set on the
62
+ figure's axis of that role (`fig.x_axis(…)`);
63
+ 2. a rule of the class (a track's axis lines from its content);
64
+ 3. the style's key for the object's class, then for its base classes (`"Series.alpha"`
65
+ reaches every series), stopping at a class that has a default of its own;
66
+ 4. for inherited settings, the parent's value (unless the class default refers to it
67
+ with `inherit`);
68
+ 5. the style's key for the setting's group (`"Marker.size"`);
69
+ 6. the class default, then the group default;
70
+ 7. for inherited settings, the style's bare name, then `DEFAULTS`'.
71
+
72
+ An owner's key always comes before its group's: `"Line.marker_size"` overrides
73
+ `"Marker.size"` for lines.
40
74
  * **Styles.** `Figure(style=…)` presets settings: a style name or a dict of settings,
41
- merged over the inherited defaults (`pl.THEME`). See [Styles](#styles).
75
+ merged over the inherited defaults (the bare names of `DEFAULTS`). See [Styles](#styles).
42
76
  * **Entry points.** `pl.Figure()`, `pl.Plot()` and the series classes (`pl.Scatter()`, …)
43
77
  each create the levels above them: `pl.Scatter(x, y)` makes a plot (`.plot`) in a new
44
78
  figure (`.plot.figure`). `fig.plot(…)` is `pl.Plot(figure=fig, …)` and `p.scatter(…)` is
45
- `pl.Scatter(…, plot=p)`. Keywords that belong to a level above go to it:
46
- `pl.Scatter(x, y, width=300, title="T")`. A name present on several levels goes to
47
- the lowest.
79
+ `pl.Scatter(…, plot=p)`. Keywords that belong to a level above go to it when the call
80
+ creates that level: `pl.Scatter(x, y, width=300, title="T")` makes and sets the plot and
81
+ the figure. Adding to an existing plot or figure takes the new object's settings only:
82
+ `p.scatter(x, y, title="T")` raises `ValueError` naming `plot.set(title=…)`. A name
83
+ present on several levels goes to the lowest.
48
84
  * **Units.** Lengths take units (`"1.5in"`, `"0.5em"`, `"60%"`); bare numbers are CSS px
49
- (1 px = 1/96 in = 0.75 pt), except slot widths (data units). See [values](#values).
85
+ (1 px = 1/96 in = 0.75 pt) everywhere. Slot widths (`Bar`, `Box`, `Violin`, `Strip`,
86
+ `Swarm` `width`) are `"80%"` of the slot or `"0.8d"` in data units. Positions along an
87
+ axis (a decoration's `min`/`max`) take bare numbers as data values. See
88
+ [values](#values).
50
89
  Images are `dpi` pixels per inch: `dpi=96` gives one image pixel per px, the default 192
51
90
  two. A dpi up to 16 is a multiple of 96: `dpi=2` is 192. PDF pages are sized in pt (× 0.75).
52
91
  * **Data.** Sequences (`None` = missing), `array.array`, or any buffer (numpy arrays are
@@ -55,7 +94,7 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
55
94
  With `data=` (a table), strings in data arguments name its columns
56
95
  ([tables](#tables-data)); dates make time axes ([dates](#dates-and-times)).
57
96
  * **Text.** Titles, axis labels and legend entries are strings or rich content: a list of
58
- strings and `pl.Span` (pdf_io's), e.g. `["Area (m", pl.Span("2",
97
+ strings and `pl.Span` (vec_io's), e.g. `["Area (m", pl.Span("2",
59
98
  baseline_shift="super", font_scale=0.7), ")"]`.
60
99
  * **Named colors.** `"blue"`, `"blue 0.45"`, `"blue 45%"`: 28 scales (`red`, `orange`,
61
100
  `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`,
@@ -66,21 +105,35 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
66
105
  a bare name is level 0.5. They take precedence over CSS's names (`"red"` is `#fb2c36`,
67
106
  not `#ff0000`); other CSS names (`"navy"`) keep their CSS values. `get()` returns the
68
107
  name as given, `resolve()` the hex color.
69
- * **Colors.** Named colors (above), any color pdf_io accepts: CSS names, `"#rrggbb[aa]"`, CSS Color 4 functions
108
+ * **Colors.** Named colors (above), any color vec_io accepts: CSS names, `"#rrggbb[aa]"`, CSS Color 4 functions
70
109
  (`"rgb(…)"`, `"hsl(…)"`, `"hwb(…)"`, `"lab(…)"`, `"lch(…)"`, `"oklab(…)"`,
71
110
  `"oklch(64.5% 0.246 16.439)"`, `"color(display-p3 1 0 0)"`, …; colors outside sRGB are
72
- gamut mapped as browsers do), tuples, `CMYK` and `Spot`; and `"C0"`, `"C1"`, … for the
111
+ gamut mapped as browsers do), tuples of numbers in [0, 1] (`(1, 0.5, 0)`; on the 0–255
112
+ scale write `"rgb(255 128 0)"`), `CMYK` and `Spot`; and `"C0"`, `"C1"`, … for the
73
113
  palette's colors.
74
114
  * **Fonts.** `font_family` is a CSS family list; weights (`font_weight`, `label_weight`,
75
115
  `tick_label_weight`) are `normal`, `bold` or 1–1000, styles `normal`, `italic`,
76
- `oblique` or `"oblique 10deg"`. With a variable font (pdf_io embeds the instance used),
116
+ `oblique` or `"oblique 10deg"`. With a variable font (vec_io embeds the instance used),
77
117
  the weight sets `wght`, the inherited `font_stretch` (`"condensed"`, `"87.5%"`) sets
78
118
  `wdth`, the style `ital` or `slnt`, `font_optical_sizing="auto"` sets `opsz` from the
79
119
  font size, and `font_variations` (`{"GRAD": 50}`) any axis:
80
120
  `pl.Figure(font_family="Roboto Flex", font_stretch="85%", font_variations={"GRAD": 50})`.
81
- * **Enums.** Enum-like settings take strings; `pl.Marker`, `pl.LineStyle`,
82
- `pl.Orientation`, `pl.Scale`, `pl.Position`, `pl.Order` and `pl.Align` are `str` enums
83
- of the same values.
121
+ * **Text and fonts.** Text is shaped by `vec_io.text` (pairs kerned) and its fonts are
122
+ embedded as subsets; plot text needs an installed outline font. Each character takes
123
+ the first family of `font_family` that is available (output options `font_dirs`, then
124
+ `VEC_IO_FONT_DIRS`, then installed fonts unless `system_fonts=False`; a family that is
125
+ not installed tries its metric aliases first: Helvetica and Arial → Liberation Sans,
126
+ Arimo, …), then a generic family's list (`sans-serif`: Arial, Helvetica, Liberation
127
+ Sans, DejaVu Sans, Noto Sans, …), then any font with the character. The default
128
+ `"SF Pro, Inter, Helvetica, Arial, sans-serif"` is SF Pro where installed, else Inter,
129
+ else Helvetica or Arial (or an alias of theirs), else the system's sans-serif. With no
130
+ outline font at all, output raises `NoFontError` (a `ValueError`, from vec_io).
131
+ * **Names.** `pl.` holds the figure and plot classes, the plot types, the value types
132
+ (`ColorAxis`, `SizeAxis`, `ColorMap`, `SizeMap`, `Palette`, `Density`, `ErrorBars`,
133
+ `Span`), `facet`, the registries (`register_layer`, `register_marker`,
134
+ `register_color_map`, `register_palette`, `register_style`), `styles` (the styles
135
+ module), `set_style`, `use_style` and `DEFAULTS`; see [modules](#12-modules) for the
136
+ rest. Enum-like settings take strings.
84
137
 
85
138
  ### Values
86
139
 
@@ -91,7 +144,8 @@ setting, or an expression:
91
144
  pl.Plot(width="3in", font_size="9pt", title="T")
92
145
  p.x_axis(tick_length="0.5em", minor_tick_length="50%", tick_rotation="0.125turn")
93
146
  p.bar(days, counts, width="20h") # a duration on a time axis
94
- p.errorbar(x, y, y_error=e, cap_length="0.2data") # data units across the bar
147
+ p.box(groups, positions=[1, 4, 9], width="0.8d") # data units (default: 80% of the slot)
148
+ p.errorbar(x, y, y_error=e, cap_length="0.2d") # data units across the bar
95
149
  p.title(font_size="large", color="var(--accent)")
96
150
  p.legend(pad="calc(1em - 2px)")
97
151
  fig.set(vars={"accent": "#c00"}) # custom variables, read by var(--name)
@@ -99,28 +153,29 @@ fig.set(vars={"accent": "#c00"}) # custom variables, read by v
99
153
 
100
154
  | Unit | Meaning |
101
155
  |---|---|
102
- | bare number | px (lengths), degrees (angles); data units for slot widths (`Bar`, `Box`, `Violin`, `Strip`, `Swarm` `width`) |
156
+ | bare number | px (lengths), degrees (angles) |
103
157
  | `px` `pt` `pc` `in` `cm` `mm` `Q` | absolute lengths |
104
158
  | `em` | the object's `font_size`; in a `font_size` setting, the parent's |
105
159
  | `rem` | the figure's `font_size` |
106
- | `%` | of the reference the setting's table entry names: another setting (`minor_tick_length`: of `tick_length`), the font size, the axes side (`tick_length`: across the axis), the slot, the box, the radius, the data range (`padding`) |
107
- | `data` | along a data axis: data units on linear axes, categories on category axes, seconds on time axes; an error on log, symlog and logit axes |
160
+ | `%` | of the reference the setting's type declares and its table entry names: another setting (`minor_tick_length`: of `tick_length`), or one of the [referents](#referents) |
161
+ | `d`, `data` | along a data axis: data units on linear axes, categories on category axes, seconds on time axes; an error on log, symlog and logit axes. On a time axis `d` is a day |
108
162
  | `ms` `s` `min` `h` `d` `w` | durations, as data units of time axes (a `timedelta` too) |
109
163
  | `fr` | a share of the room left by fixed tracks, in `Figure.widths`/`heights` |
110
164
  | `deg` `grad` `rad` `turn` | angles |
111
165
  | `xx-small` … `xx-large`, `smaller`, `larger` | font sizes: × 0.579 … 1.728 of `rem`; ÷/× 1.2 of the parent's |
112
166
 
113
167
  * **`var(name[, fallback])`** reads another setting of the object, resolved through the
114
- usual inheritance; `var()` of the setting's own name reads the parent's value
115
- (`alpha="calc(var(alpha) / 2)"`). `var(--name)` reads a custom variable: from the
168
+ usual inheritance. **`inherit`** (or `var()` of the setting's own name) reads the
169
+ parent's value of the same setting (`alpha="calc(inherit / 2)"`). `var(--name)` reads a custom variable: from the
116
170
  nearest `vars` (figure or plot), else a `"--name"` key of the style. The fallback is used
117
171
  when the value is unset. Loops raise. Text settings (titles, labels, names, formats)
118
172
  never read `var()`.
119
- * **`calc()`** takes `+ - * /`, parentheses, numbers, dimensions with any unit and
120
- `var()`: dimensions add to dimensions and multiply or divide by numbers.
173
+ * **`calc()`** takes `+ - * /`, parentheses, numbers, dimensions with any unit, `var()`
174
+ and `inherit`: dimensions add to dimensions and multiply or divide by numbers.
121
175
  * **Layout.** `%` of the axes is exact with `reference="axes"` (the axes size is given)
122
- and resolved inside the layout loop otherwise; it is known only while the figure is
123
- drawn. `spacing`, `margin` and fixed `widths`/`heights` in `%` of the figure are solved
176
+ and resolved in each [layout](#layout) round otherwise; it is known only while the
177
+ figure is drawn. A render first resolves every other setting of the figure once (the values
178
+ drawing reads); settings set while it runs take effect at once. `spacing`, `margin` and fixed `widths`/`heights` in `%` of the figure are solved
124
179
  exactly when the figure size follows from its contents.
125
180
  * **Scaling.** `Figure.scaling` multiplies every absolute length (px and physical units)
126
181
  wherever it is given: on objects, in styles, in `DEFAULTS`; not the figure size.
@@ -130,10 +185,73 @@ fig.set(vars={"accent": "#c00"}) # custom variables, read by v
130
185
  (`resolve(name, of=…)` for settings whose `%` reference the caller passes), and
131
186
  `explain(name)` a trace:
132
187
 
188
+ #### Referents
189
+
190
+ What `%` of a length can be of, besides another setting (the tables name it per setting):
191
+
192
+ <!-- settings:referents -->
193
+ | Key | `%` of |
194
+ |---|---|
195
+ | `em` | the font size |
196
+ | `axes_width` | the axes width |
197
+ | `axes_height` | the axes height |
198
+ | `across` | the axes side across the axis |
199
+ | `along` | the axes side along the axis |
200
+ | `axes` | the axes width (across) or height (down) |
201
+ | `axes_length` | the axes length along the axis |
202
+ | `data_range` | the axis range |
203
+ | `bar_across` | the axes side across the colorbar |
204
+ | `bar_along` | the axes side along the colorbar |
205
+ | `figure` | the figure width (across) or height (down) |
206
+ | `slot` | the slot: one category, or the smallest gap between positions |
207
+ | `slot_part` | each series' part of a shared slot |
208
+ | `box_width` | the box width |
209
+ | `radius` | the radius |
210
+ <!-- /settings -->
211
+
212
+ #### Setting groups
213
+
214
+ Members, their names under a prefix `{p}`, and the group defaults (`"Group.member"` keys).
215
+ `"FillStyle.fill"` sets every series fill (bars, boxes, violins, pies, densities,
216
+ contours, genome signals and intervals); `"Marker.fill"` every marker fill.
217
+
218
+ <!-- settings:groups -->
219
+ | Group | Member | Under a prefix `{p}` | Default |
220
+ |---|---|---|---|
221
+ | `Font` | `font_size` | `{p}font_size` | inherited |
222
+ | `Font` | `font_family` | `{p}font_family` | inherited |
223
+ | `Font` | `font_stretch` | `{p}font_stretch` | inherited |
224
+ | `Font` | `font_variations` | `{p}font_variations` | inherited |
225
+ | `Font` | `font_optical_sizing` | `{p}font_optical_sizing` | inherited |
226
+ | `TextStyle` | `font_size` | `{p}font_size` | '1em' |
227
+ | `TextStyle` | `font_weight` | `{p}weight` | 'normal' |
228
+ | `TextStyle` | `font_style` | `{p}style` | 'normal' |
229
+ | `TextStyle` | `color` | `{p}color` | 'var(text_color)' |
230
+ | `Stroke` | `color` | `{p}color` | — |
231
+ | `Stroke` | `line_width` | `{p}width` | 0.75 |
232
+ | `Stroke` | `line_style` | `{p}style` | 'solid' |
233
+ | `Stroke` | `cap` | `{p}cap` | 'butt' |
234
+ | `Stroke` | `join` | `{p}join` | 'round' |
235
+ | `Marker` | `marker` | `marker (never prefixed)` | 'circle' |
236
+ | `Marker` | `size` | `{p}size` | 4.5 |
237
+ | `Marker` | `color` | `{p}color` | — |
238
+ | `Marker` | `edge_color` | `{p}edge_color` | 'auto' |
239
+ | `Marker` | `edge_width` | `{p}edge_width` | 0.75 |
240
+ | `Marker` | `fill` | `{p}fill` | True |
241
+ | `Marker` | `size_basis` | `size_basis (never prefixed)` | 'area' |
242
+ | `FillStyle` | `fill` | `{p}fill` | — |
243
+ | `NumberFormat` | `decimal_separator` | `{p}decimal_separator` | inherited |
244
+ | `NumberFormat` | `thousands_separator` | `{p}thousands_separator` | inherited |
245
+ | `NumberFormat` | `minus` | `{p}minus` | inherited |
246
+ | `NumberFormat` | `prefix` | `{p}prefix` | inherited |
247
+ | `NumberFormat` | `suffix` | `{p}suffix` | inherited |
248
+ | `NumberFormat` | `precision` | `{p}precision` | inherited |
249
+ <!-- /settings -->
250
+
133
251
  ```
134
252
  >>> pl.Plot(style="matplotlib").x_axis.explain("tick_spacing")
135
- Axis.tick_spacing = (46.6667px, 33.3333px) ← ('calc(3.5 * var(tick_font_size))', 'calc(2.5 * var(tick_font_size))') (default Axis.tick_spacing)
136
- Axis.tick_font_size = 13.3333px ← '1em' (default Axis.tick_font_size)
253
+ Axis.tick_spacing = (46.6667px, 33.3333px) ← ('calc(3.5 * var(tick_label_font_size))', 'calc(2.5 * var(tick_label_font_size))') (default Axis.tick_spacing)
254
+ Axis.tick_label_font_size = 13.3333px ← '1em' (default Axis.tick_label_font_size)
137
255
  Axis.font_size = 13.3333px ← '10.0pt' (inherited from Figure: style "matplotlib" font_size)
138
256
  ```
139
257
 
@@ -142,17 +260,29 @@ Axis.tick_spacing = (46.6667px, 33.3333px) ← ('calc(3.5 * var(tick_font_size))
142
260
  ```python
143
261
  pl.Figure(**settings)
144
262
  fig.plot(id=None, **settings) # the plot with id (created if needed), or the next one
263
+ fig.scatter(x, y, **settings) # any plot type: a new plot holding it
145
264
  fig.title(text, **settings) # figure title
146
- fig.colorbar(source, id=None, **settings)
265
+ fig.x_axis(**settings) # settings of every plot's x axis (fig.y_axis: y)
266
+ fig.colorbar(source, id=None, **settings) # the guide of a color axis, in its own area
267
+ fig.color_axis(**settings) # a shared color axis (fig.size_axis: size)
268
+ fig.size_legend(source, id=None, values=None, title=None)
269
+ fig.track(**settings) # a new track (layout="tracks")
270
+ fig.vline(x, rows=None, **settings) # through plots and the gaps between them
271
+ fig.vspan(x0, x1=None, rows=None, **settings)
272
+ fig.group(first, last=None, label=None, letter=None)
147
273
  fig.plots # plots in creation order
148
274
  ```
149
275
 
276
+ A plot type called on the figure (`fig.scatter(…)`, `fig.hist(…)`, `fig.bigwig(…)`) makes
277
+ a new plot holding it and returns the series: the plot's settings that the plot type
278
+ lacks, `title`, `x_axis` and `y_axis` go to the plot.
279
+
150
280
  ### Arrangement
151
281
 
152
- * **Grid.** `grid=[[1, 1, 2], [3, 3, 2]]`: each id covers a rectangle of cells; `0` or
282
+ * **Grid.** `layout=[[1, 1, 2], [3, 3, 2]]`: each id covers a rectangle of cells; `0` or
153
283
  `None` leaves a cell empty. An id holds a plot or a colorbar. `fig.plot()` returns the
154
284
  next id without a plot, in reading order.
155
- * **Automatic.** Plots take positions in creation order:
285
+ * **Automatic** (`layout="auto"`, the default). Plots take positions in creation order:
156
286
 
157
287
  | Settings | Arrangement |
158
288
  |---|---|
@@ -161,9 +291,16 @@ fig.plots # plots in creation order
161
291
  | `rows=2, cols=3` | a fixed 2 × 3 grid, row by row (full: `ValueError`) |
162
292
  | neither | ⌈√n⌉ columns, row by row, chosen when drawn (adding plots can move earlier ones) |
163
293
 
164
- `order` (`"row"` or `"col"`) overrides the fill direction. In automatic arrangement ids
294
+ `fill_order` (`"row"` or `"col"`) overrides the fill direction. In automatic arrangement ids
165
295
  are names; `fig.plot()` gives 1, 2, 3, … skipping taken ids.
166
296
 
297
+ * **Tracks.** `layout="tracks"`: one column of plots top to bottom in creation order
298
+ (`cols` 1), sharing x (`share_x="all"`), `spacing` 0 and `width` 480 px unless given;
299
+ each row is as high as its plot's `height` (a [track](#tracks)'s: a length, a share such
300
+ as `"1fr"`, or from its content), other plots `1fr`. New plots are tracks
301
+ (`fig.plot()`, `fig.track()`, `fig.bigwig(…)`). `pl.Tracks(region)` is this layout with
302
+ a genome x axis ([§9](#9-genome-tracks)).
303
+
167
304
  ### Sizes and alignment
168
305
 
169
306
  * `width` × `height` is the size of the box `reference` names:
@@ -171,8 +308,8 @@ are names; `fig.plot()` gives 1, 2, 3, … skipping taken ids.
171
308
  * `"plot"`: each cell's whole plot box (axes and decorations); the figure size follows;
172
309
  * `"figure"`: the whole figure; the cells share what the decorations leave.
173
310
 
174
- With only one of `width` and `height`, `aspect_ratio` (width / height, default 4/3)
175
- gives the other; with neither, the default is 3 × 2.25 in (288 × 216 px). Giving all
311
+ With only one of `width` and `height`, `aspect_ratio` (width / height, default 5/4)
312
+ gives the other; with neither, the default is 150 × 120 px. Giving all
176
313
  three raises `ValueError`. Plots with a `data_ratio` (and pies) take the other side from
177
314
  it when only `width` or only `height` is given. `widths`/`heights` are the columns' and
178
315
  rows' ratios (numbers or `fr`), or fixed lengths (`["2in", "1fr", "1fr"]`) that the
@@ -192,8 +329,38 @@ are names; `fig.plot()` gives 1, 2, 3, … skipping taken ids.
192
329
  * Columns (rows) holding only vertical (horizontal) colorbars are as wide as the bar,
193
330
  unless `widths` (`heights`) is given.
194
331
  * Margins come from the real text metrics of tick labels, axis labels, titles, outside
195
- legends and attached colorbars. The layout repeats until the axes sizes settle (tick
196
- choice depends on axis length).
332
+ legends and attached colorbars ([layout](#layout)).
333
+
334
+ ### Layout
335
+
336
+ * **Bands.** A plot is its axes rectangle with four stacks of bands around it, from the
337
+ axes outward: tick marks, tick labels, the ×10ᵏ offset (above the y axis), the axis
338
+ label, twin axes, an outside legend, attached colorbars, the plot title (top) and the
339
+ plot's `space_above`; outermost on the left, the row label and group bands, as wide as the
340
+ widest of the plot's grid column. Each band has a thickness and an overhang along its
341
+ side (tick labels past the ends of the axis, a wide title). A side's margin is its
342
+ bands' thicknesses, at least the overhangs of the bands across it. Bands stack: each
343
+ starts past the ones before it (mirrored ticks included), the title past everything on
344
+ top; only twin axes are drawn at the axes edge.
345
+ * **Grid.** Each line between cells takes the largest margin of the plots there
346
+ (`align="axes"`), or each plot's axes are what its margins leave of its box
347
+ (`"borders"`). Colorbars and size legends in their own areas are cells of the grid; the
348
+ figure title is a band at the top of the figure.
349
+ * **Rounds.** Only what is circular is repeated: an axis' length sets its ticks, whose
350
+ labels set the margins, which (with `reference="plot"` or `"figure"`) set the length;
351
+ `data_ratio`; stats binned at the axes' resolution ([hexbin](#hexbin), genome
352
+ [bins](#9-genome-tracks)); the figure title's band in a figure of fixed height. A round
353
+ measures every plot for its axes size and solves the grid. Rounds stop when no axes size
354
+ moves by more than 1/3 px; after 5, a layout still moving (between two tick sets) keeps
355
+ the last. With `reference="axes"` one round suffices. `position="auto"` legends are
356
+ placed on the occupancy grid of the placed axes; one moved outside takes a round more.
357
+ * **Geometry.** The layout ends in a frozen geometry: every axes rectangle, tick mark,
358
+ text run, legend entry and colorbar in px. Drawing reads it and measures nothing: a text
359
+ run holds its shaped line (shaped once per content and font, memoized in the font
360
+ database), which is what is drawn; the figure title is laid out once as paragraphs.
361
+ * **One plot.** `p.save()` lays out the whole figure and keeps the plot at its size in it:
362
+ its axes (`align="axes"`), or its box (`"borders"`: the axes are what its own margins
363
+ leave), with its outer tick labels and its own row label band.
197
364
 
198
365
  ### Figure title
199
366
 
@@ -208,7 +375,7 @@ rightmost axes (a left-aligned title starts at the first y axis line), `"figure"
208
375
  the figure minus `margin`. Rich content styles a second line (`["Title\n",
209
376
  pl.Span("subtitle", font_size=7, font_weight="normal")]`). It is drawn last and is not
210
377
  part of `Plot.save`. `title=` given to `pl.Plot` sets the plot title. The figure's
211
- `title_rule` (a color) draws a rule `title_rule_width` thick above the title, across its
378
+ `title_rule_color` draws a rule `title_rule_width` thick above the title, across its
212
379
  width.
213
380
 
214
381
  <!-- settings:FigureTitle -->
@@ -216,17 +383,19 @@ width.
216
383
  |---|---|---|
217
384
  | `text` | — | Title text: a string or rich content; `\n` starts a line. |
218
385
  | `font_size` | '1em' | Font size; default the base font size. Length; `%`: of the parent's font size. |
219
- | `font_weight` | 'bold' | `bold`, `normal` or a weight 1–1000. |
386
+ | `font_weight` | 'bold' | `normal`, `bold` or a weight 1–1000. |
220
387
  | `font_style` | 'normal' | `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
221
388
  | `align` | 'center' | Alignment. |
222
389
  | `over` | 'axes' | Width it is aligned and wrapped within: from the leftmost to the rightmost axes, or the whole figure. |
223
390
  | `pad` | '0.5em' | Gap between the title and the plots; default half the font size. Length. |
224
391
  | `color` | 'var(text_color)' | Text color. |
225
- | `rule_gap` | '0.5em' | Gap between the title and the figure's `title_rule`. Length; `%`: of the font size. |
392
+ | `rule_gap` | '0.5em' | Gap between the title and the figure's `title_rule_color`. Length; `%`: of the font size. |
226
393
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
227
394
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
228
395
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
229
396
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
397
+
398
+ Groups: `TextStyle`, `Font`.
230
399
  <!-- /settings -->
231
400
 
232
401
  ### Shared axes
@@ -241,10 +410,11 @@ q = fig.plot(share_x=p) # q's x axis joins p's group
241
410
  the same column span) or `"row"` (the same row span). `share` sets both; `"grid"` means x
242
411
  per column and y per row. A plot's own `share_x`, `share_y` or `share` (another plot)
243
412
  overrides the figure's groups for it; groups chain. Colorbars and plots without axes are
244
- never in a group.
413
+ never in a group. `share_color` and `share_size` group plots the same way for their
414
+ series' color and size axes ([color and size axes](#6-color-and-size-axes)).
245
415
 
246
416
  Within a group the scale (which must be equal), the limits (from all members' series,
247
- then padding, `include_zero` and `nice`; one explicit `limits` applies to the group, two
417
+ then padding, `include_zero` and `snap`; one explicit `limits` applies to the group, two
248
418
  different ones are an error), inversion, ticks and category order (first appearance, in
249
419
  plot order) are shared; titles, grid, spines and colors stay per plot. With
250
420
  `label_outer` (default for figure-level groups), tick labels and axis titles are drawn
@@ -252,52 +422,146 @@ only on the bottom plot of each column (x; top for `side="top"`) and the left pl
252
422
  each row (y; right for `side="right"`); ticks stay on every plot and inner gutters
253
423
  shrink. `Plot.save` of a member keeps the group's limits and shows its labels.
254
424
 
425
+ ### Figure axes
426
+
427
+ ```python
428
+ fig.x_axis(label="Time (s)", tick_format="int") # every plot's x axis
429
+ fig.y_axis(scale="log10")
430
+ ```
431
+
432
+ `fig.x_axis` and `fig.y_axis` hold settings that every plot's x (y) axis takes unless the
433
+ axis has its own: they come right after the axis' own values in the cascade
434
+ ([§1](#1-conventions)), so they beat styles and defaults. Twins' axes take them too; color
435
+ and size axes do not.
436
+
437
+ ### Rows
438
+
439
+ ```python
440
+ p = fig.plot(y_axis={"label": "Control", "label_position": "band"}) # a row label
441
+ fig.group(p, q, label="Treated", letter="B") # plots p to q (creation order)
442
+ fig.vline(0, rows=[p, q]) # through p, q and the gap between them
443
+ fig.vspan(-1, 1) # under every plot
444
+ ```
445
+
446
+ * **Row labels.** The y axis' `label` with `label_position` `"band"` (rotated) or
447
+ `"left"` (horizontal, right-aligned) sits in a band left of the plot instead of beside
448
+ the tick labels; `"inside"` puts it inside the axes at the top left; `\n` starts a line.
449
+ The band is as wide as the widest label of the plots starting in the same grid column,
450
+ and the labels line up at the widest y axis margin of that column. A plot has one y
451
+ label: beside its axis or in the band. Tracks put theirs in the band. A plot's
452
+ `space_above` adds space above it.
453
+ * **Groups.** `fig.group(first, last=None, **settings)`: plots `first` to `last` (plots
454
+ or their series, in creation order) with a rotated `label` and a bold panel `letter` in a
455
+ band left of the row labels. With a shared x axis and `label_outer`, the group's last
456
+ plot shows the tick labels too (the axis title stays under the bottom plot).
457
+ * **Lines and bands.** `fig.vline(x, rows=None)` and `fig.vspan(x0, x1, rows=None)` run
458
+ from the top of the first of the plots `rows` (a plot, a series, or a list; all by
459
+ default) to the bottom of the last one, gaps included, in each grid column; `x` is in
460
+ the drawn units of the first plot's x axis. Bands are drawn under the plots, lines over
461
+ them. `fig.vspan(region)` takes a genome region (`"chr1:1,400,001-1,450,000"`, a
462
+ `(chr, start, end)` tuple) as positions, less the x axis' `origin`.
463
+
464
+ FigureVLine:
465
+
466
+ <!-- settings:FigureVLine -->
467
+ | Setting | Default | Meaning |
468
+ |---|---|---|
469
+ | `color` | '#4d4d4d' | Line color. |
470
+ | `line_width` | inherited (0.75) | Line width. Length. |
471
+ | `line_style` | 'dashed' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list. Length. |
472
+ | `alpha` | 1.0 | Opacity. |
473
+
474
+ Groups: `Stroke`.
475
+ <!-- /settings -->
476
+
477
+ FigureVSpan:
478
+
479
+ <!-- settings:FigureVSpan -->
480
+ | Setting | Default | Meaning |
481
+ |---|---|---|
482
+ | `color` | '#e5e5e5' | Fill color. |
483
+ | `alpha` | 1.0 | Opacity. |
484
+ <!-- /settings -->
485
+
486
+ FigureGroup:
487
+
488
+ <!-- settings:FigureGroup -->
489
+ | Setting | Default | Meaning |
490
+ |---|---|---|
491
+ | `label` | — | Group label, rotated, left of the plots' row labels. |
492
+ | `letter` | — | Panel letter at the group's top left. |
493
+ | `font_size` | '1em' | Font size of the label. Length; `%`: of the parent's font size. |
494
+ | `letter_font_size` | '1.4em' | Font size of the letter. Length; `%`: of the font size. |
495
+ | `letter_weight` | 'bold' | Weight of the letter. |
496
+ | `pad` | '0.5em' | Gap right of the group band. Length; `%`: of the font size. |
497
+ | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
498
+ | `text_color` | inherited ('black') | Text color. |
499
+
500
+ Groups: `TextStyle` (`letter_`).
501
+ <!-- /settings -->
502
+
255
503
  ### Facets
256
504
 
257
505
  ```python
258
- fig = pl.facet(df, col="condition", row="replicate", share="grid", colorbar="right")
259
- fig.scatter("x", "y", c="density") # in every panel, on its rows
260
- fig.map(lambda p, rows: p.hist(rows["x"])) # anything, per panel
506
+ fig, panels = pl.facet(df, col="condition", row="replicate", colorbar="right")
507
+ panels.scatter("x", "y", c="density") # one layer per panel, on its rows
508
+ panels.hline(0, line_style="dashed") # decorations on every panel
509
+ panels.map(lambda p, rows: p.hist(rows["x"])) # anything, per panel
510
+ fig.save("facets.pdf")
261
511
  ```
262
512
 
263
513
  `pl.facet(data, col=None, row=None, wrap=None, share="grid", order=None,
264
- title_format="{name} = {value}", colorbar=None, **figure_settings)` returns a
265
- `FacetFigure` with one plot per combination of `row` and `col` values (first-appearance
266
- or categorical order; `order={column: [values]}`), in a grid; `wrap` wraps `col` alone
267
- into rows of that many panels. Panels are titled by `title_format`. Series methods on the
268
- figure call the same method on every panel with `data=` its rows: group levels get the same
269
- colors in every panel, and numbers or densities in `color` share one `ColorMap` (shown by
270
- the extra-column colorbar with `colorbar="right"`). `fig.map(func)` calls `func(plot,
271
- rows)` per panel; `fig.panels` maps facet keys (a value, or `(row value, col value)`) to
272
- plots, and `fig.plot(key)` returns one. Axes are shared per column and row by default,
273
- with outer labels only.
514
+ title_format="{name} = {value}", colorbar=None, **figure_settings)` returns an ordinary
515
+ `Figure`, with one plot per combination of `row` and `col` values (first-appearance or
516
+ categorical order; `order={column: [values]}`) in a grid, and the `FacetSet` of those
517
+ panels. `wrap` wraps `col` alone into rows of that many panels. Panels are titled by
518
+ `title_format`.
519
+
520
+ * **Layers.** A plot type called on the set (`panels.scatter(…)`, any registered one)
521
+ calls it on every panel with `data=` the panel's rows and returns a `LayerSet` (a list
522
+ of the series; `.set(**settings)` sets them all, `.plots` their plots). Group levels
523
+ (`group=`) get the same colors in every panel. Decorations (`hline`, `vline`, `axline`,
524
+ `hspan`, `vspan`, `text`, `annotate`) go on every panel.
525
+ * **Shared axes** are the figure's ordinary options: `share` (default `"grid"`: x per
526
+ column, y per row, outer labels only), `share_color` (default `"all"`: the panels'
527
+ color axes train as one; a `color_map`, `color_limits` or `color_scale` given to the
528
+ call goes to each series alike) and `share_size` (default `"all"`: one size axis, so
529
+ one size key, in the top-right panel's legend).
530
+ * **Colorbar.** `colorbar="right"`, `"left"`, `"top"` or `"bottom"` adds a column (or a
531
+ row, with a horizontal bar) to the grid, holding the colorbar of the first call that maps
532
+ colors (`panels.colorbar`): the guide of the panels' shared color axis.
533
+ * `panels.panels` maps facet keys (a value, or `(row value, col value)`) to plots;
534
+ `panels.plot(key)` returns one; iterating the set gives the plots; `panels.subsets()`
535
+ gives `(key, plot, rows)`.
274
536
 
275
537
  ### Settings
276
538
 
277
539
  <!-- settings:Figure -->
278
540
  | Setting | Default | Meaning |
279
541
  |---|---|---|
280
- | `grid` | — | Rows of ids; each id covers a rectangle of cells, `0`/`None` leaves a cell empty. |
542
+ | `layout` | 'auto' | `auto`: plots in automatic rows and columns (`rows`, `cols`, `fill_order`); rows of ids (`[[1, 1, 2], [3, 4, 2]]`): each id covers a rectangle of cells, `0`/`None` leaves a cell empty; `tracks`: one column of plots top to bottom in creation order, sharing x, each row as high as its plot's `height` (tracks: from their content; other plots `1fr`). |
281
543
  | `rows` | — | Automatic arrangement: rows. |
282
544
  | `cols` | — | Automatic arrangement: columns. |
283
- | `order` | 'auto' | Fill order of the automatic arrangement: `auto` (row by row with `cols`, column by column with `rows`), `row` or `col`. |
545
+ | `fill_order` | 'auto' | Fill order of the automatic arrangement: `auto` (row by row with `cols`, column by column with `rows`), `row` or `col`. |
284
546
  | `align` | 'axes' | `axes`: axis lines line up across plots; `borders`: plot boxes line up. |
285
547
  | `widths` | — | Column widths: ratios (numbers or `fr`) sharing the room left by fixed lengths (`"2in"`, `"30%"` of the figure width). |
286
548
  | `heights` | — | Row heights, as `widths`. |
287
- | `width` | '3in' | Width of the `reference` box: one cell's axes, one cell's plot, or the figure. Length. |
549
+ | `width` | '150px' | Width of the `reference` box: one cell's axes, one cell's plot, or the figure. Length. |
288
550
  | `height` | 'calc(var(width) / var(aspect_ratio))' | Height of the `reference` box. Length. |
289
- | `aspect_ratio` | 1.3333333333333333 | Width / height of the `reference` box (16:9 → `16 / 9`), when only one of `width` and `height` is given. |
551
+ | `aspect_ratio` | 1.25 | Width / height of the `reference` box (16:9 → `16 / 9`), when only one of `width` and `height` is given. |
290
552
  | `reference` | 'axes' | What `width` and `height` measure: `axes` (each grid cell's axes rectangle), `plot` (each cell's whole plot box) or `figure`. |
291
- | `spacing` | 13.0 | Minimum gap between neighbouring plots. Length. |
292
- | `margin` | 5.0 | Space around the figure. Length. |
293
- | `background` | — | Figure background; unset: transparent (white in JPEG, which has no transparency). |
553
+ | `spacing` | 13.0 | Minimum gap between neighbouring plots. Length; `%`: of the figure width (across) or height (down). |
554
+ | `margin` | 5.0 | Space around the figure. Length; `%`: of the figure width (across) or height (down). |
555
+ | `background` | 'white' | Figure background, default white; `None` or `"none"`: transparent (white in JPEG, which has no transparency). |
294
556
  | `dpi` | 192.0 | Resolution of PNG, JPEG, JPEG XL and AVIF output: `96` gives one image pixel per px, the default `192` two; up to 16, a multiple of 96 (`2` is 192). |
295
- | `quality` | — | Quality (1–100), as pdf_io's: of JPEG, JPEG XL and AVIF output, and of rasterized content in PDFs (stored as JPEG). Unset: pdf_io's defaults (JPEG 90; JPEG XL, AVIF and PDF images lossless). |
296
- | `title_rule` | — | Color of a rule above the figure title, across its width (The Economist's red bar); default none. |
557
+ | `quality` | 'auto' | Quality (1–100), as vec_io's: of PNG output (a lossy palette of at most 256 colors), JPEG, JPEG XL and AVIF output, and of rasterized content in PDFs (stored as JPEG); `"lossless"` (not JPEG); `"auto"`: 90 for PNG and JPEG, lossless for JPEG XL, AVIF and PDF content. |
558
+ | `title_rule_color` | — | Color of a rule above the figure title, across its width (The Economist's red bar); default none. |
297
559
  | `title_rule_width` | 4.0 | Thickness of the title rule. Length. |
298
560
  | `share_x` | — | Plots sharing their x axis: `False`, `True`/`"all"`, `"col"` (same column span) or `"row"` (same row span). |
299
561
  | `share_y` | — | Plots sharing their y axis, as `share_x`. |
300
562
  | `share` | — | Both axes at once: as `share_x`, or `"grid"` (x per column, y per row); `share_x`/`share_y` override it. |
563
+ | `share_color` | False | Plots whose series' own color axes are one (limits over all their values), as `share_x`. |
564
+ | `share_size` | False | Plots whose series' own size axes are one (limits over all their values, one size key), as `share_x`. |
301
565
  | `label_outer` | — | Tick labels and axis titles of shared axes only on the outer plots (bottom of each column, left of each row); default `True` for groups from the figure's settings, `False` for plots paired with `share_x=plot`. |
302
566
  | `style` | — | A style name (`"ggplot2"`, …) or a dict of settings with an optional `"base"`; default: the session style (`set_style`, `use_style`), else `"default"`. |
303
567
  | `vars` | — | Custom variables, read by `var(--name)` in any setting here and below: `{"accent": "#c00"}`. |
@@ -308,11 +572,11 @@ with outer labels only.
308
572
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
309
573
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
310
574
  | `text_color` | inherited ('black') | Text color. |
311
- | `line_width` | inherited (1.25) | Default line width. Length. |
312
- | `palette` | inherited (10 colors) | Colors of series without one. |
575
+ | `line_width` | inherited (0.75) | Default line width. Length. |
576
+ | `palette` | inherited ('tab10_custom') | Colors of series without one. |
313
577
  | `alpha` | inherited (1.0) | Default opacity of series. |
314
578
  | `rasterize` | inherited (False) | `True` or a dpi: series drawn as images inside the PDF. |
315
- | `simplify` | inherited ('auto') | pdf_io's `simplify` for every series; default `"auto"`. |
579
+ | `simplify` | inherited ('auto') | vec_io's `simplify` for every series; default `"auto"`. |
316
580
  | `data` | inherited (None) | A table whose columns the series' data arguments name. |
317
581
  | `color_map` | inherited ('rainbow_llhh') | Default color map (alias `cmap`): of heatmaps, contours and numbers given as colors. |
318
582
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
@@ -321,12 +585,14 @@ with outer labels only.
321
585
  | `prefix` | inherited ('') | Text before every number. |
322
586
  | `suffix` | inherited ('') | Text after every number. |
323
587
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
588
+
589
+ Groups: `Stroke` (`title_rule_`), `Font`, `NumberFormat`.
324
590
  <!-- /settings -->
325
591
 
326
592
  ## 3. Plots
327
593
 
328
594
  ```python
329
- pl.Plot(figure=None, id=None, **settings) # title="…" sets the title text
595
+ pl.Plot(figure=None, id=None, **settings) # title="…", x_axis={…}, y_axis={…}
330
596
  p.scatter(x, y, **s) p.line(x, y=None, **s) p.fill(x, y1, y2=0, **s)
331
597
  p.box(values, **s) p.heatmap(values, **s) p.colorbar(source=None, **s)
332
598
  p.title(text, **s) p.x_axis(label, **s) p.y_axis(label, **s) p.legend(position, **s)
@@ -334,7 +600,9 @@ p.series p.colorbars p.figure p.id
334
600
  ```
335
601
 
336
602
  `p.title`, `p.x_axis`, `p.y_axis` and `p.legend` are objects; calling one sets its
337
- settings and returns it. Series are drawn in `z` order (default: call order) inside the
603
+ settings and returns it. At creation (and in `p.set`), `title=` sets the title text and
604
+ `x_axis={…}`, `y_axis={…}` set the axes' settings: `pl.Scatter(x, y, x_axis={"scale":
605
+ "log"})`, `fig.bigwig(reader, y_axis={"label": "ATAC"})`. Series are drawn in `z` order (default: call order) inside the
338
606
  axes clip.
339
607
 
340
608
  <!-- settings:Plot -->
@@ -343,7 +611,7 @@ axes clip.
343
611
  | `spines` | 'bottom left' | Axis lines drawn: any of `left`, `bottom`, `right`, `top`, or `all`, `none`. |
344
612
  | `data_ratio` | — | Data aspect ratio: 1 makes one unit as long on both axes. |
345
613
  | `background` | — | Background color of the axes area. |
346
- | `border` | — | Color of a frame around the axes area (drawn under the axis lines); default none. |
614
+ | `border_color` | — | Color of a frame around the axes area (drawn under the axis lines); default none. |
347
615
  | `border_width` | 0.75 | Width of the frame. Length. |
348
616
  | `clip` | True | Clip series to the axes area. |
349
617
  | `axes` | True | Draw axes; `False` hides both axes, drops padding and fixes the aspect to 1 (set by pie charts). |
@@ -351,17 +619,18 @@ axes clip.
351
619
  | `share_y` | — | Another plot whose y axis this plot shares. |
352
620
  | `vars` | — | Custom variables, read by `var(--name)` in any setting here and below: `{"accent": "#c00"}`. |
353
621
  | `share` | — | Another plot whose x and y axes this plot shares. |
622
+ | `space_above` | 0.0 | Space above the plot, beyond the figure's `spacing`. Length; `%`: of the font size. |
354
623
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
355
624
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
356
625
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
357
626
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
358
627
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
359
628
  | `text_color` | inherited ('black') | Text color. |
360
- | `line_width` | inherited (1.25) | Default line width. Length. |
361
- | `palette` | inherited (10 colors) | Colors of series without one. |
629
+ | `line_width` | inherited (0.75) | Default line width. Length. |
630
+ | `palette` | inherited ('tab10_custom') | Colors of series without one. |
362
631
  | `alpha` | inherited (1.0) | Default opacity of series. |
363
632
  | `rasterize` | inherited (False) | `True` or a dpi: series drawn as images inside the PDF. |
364
- | `simplify` | inherited ('auto') | pdf_io's `simplify` for every series: `"auto"`, `True`, a dpi or `False`. |
633
+ | `simplify` | inherited ('auto') | vec_io's `simplify` for every series: `"auto"`, `True`, a dpi or `False`. |
365
634
  | `color_map` | inherited ('rainbow_llhh') | Default color map (alias `cmap`): of heatmaps, contours and numbers given as colors. |
366
635
  | `data` | inherited (None) | A table (dict, pandas or polars data frame, numpy structured array): strings in the data arguments of series name its columns. |
367
636
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
@@ -370,6 +639,8 @@ axes clip.
370
639
  | `prefix` | inherited ('') | Text before every number. |
371
640
  | `suffix` | inherited ('') | Text after every number. |
372
641
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
642
+
643
+ Groups: `Stroke` (`border_`), `Font`, `NumberFormat`.
373
644
  <!-- /settings -->
374
645
 
375
646
  ### Title
@@ -389,6 +660,8 @@ axes clip.
389
660
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
390
661
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
391
662
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
663
+
664
+ Groups: `TextStyle`, `Font`.
392
665
  <!-- /settings -->
393
666
 
394
667
  ### Legend
@@ -398,13 +671,19 @@ swatch or box), or with `glyph="box"`, `"circle"` or `"line"` in the series colo
398
671
  `top`, `bottom`, `outside_top` and `outside_bottom` entries are side by side unless
399
672
  `orientation` or `columns` is set.
400
673
 
401
- **Size keys.** A series whose `size` goes through a `size_map` adds a size key to its
402
- plot's legend, below the series entries: the map's `label` (default: the `size` column
403
- name) as a header, then sample markers at their real size with their values (3–5 nice
404
- numbers inside the map's limits, or the list given as the series' `size_legend`;
405
- `size_legend=False` drops it). Series sharing one `SizeMap` share one key, in grey; a
406
- single series' key takes its color (grey when its colors are mapped). `fig.size_legend(size_map,
407
- id=…, values=None, title=None)` places a key in its own grid area, as colorbars do.
674
+ **Size keys.** A series whose `size` goes through a [size axis](#6-color-and-size-axes)
675
+ adds a size key, the axis' guide, to its plot's legend, below the series entries: the
676
+ axis' `label` (default: the `size` column name) as a header, then sample markers at their
677
+ real size with their values (the list given as the series' `size_legend`, else the axis'
678
+ `ticks`, else 3–5 nice numbers inside its limits; in its `tick_format`;
679
+ `size_legend=False` drops it). Series sharing one size axis (one `fig.size_axis()`, or own
680
+ axes trained as one by `share_size` or `group=`) share one key, in grey, also across
681
+ plots. The key goes in the legend of the rightmost of their plots, and the topmost of
682
+ those, so it sits at the figure's top right. Users with different `size_map`s get a key
683
+ per map. A single series' key takes its color (grey when its colors are mapped).
684
+ `fig.size_legend(source, id=…, values=None, title=None)` places the key of a size axis
685
+ (or of a series' one) in its own grid area, as colorbars do. It shows every series of
686
+ that axis, and no plot legend repeats it.
408
687
 
409
688
  `auto` chooses a position once the axes are placed. Every series marks what it draws on a
410
689
  64 × 64 grid over the axes: markers (with their size), lines and curves (along their
@@ -423,19 +702,19 @@ candidate covers more than 2 % marked cells; else the candidate covering the few
423
702
  | `position` | 'auto' | `auto`, `top_right`, `top_left`, `bottom_right`, `bottom_left`, `top`, `bottom`, `outside_right`, `outside_top`, `outside_bottom` or `none`. |
424
703
  | `columns` | 1 | Number of columns. |
425
704
  | `frame` | False | Draw a frame and background. |
426
- | `title` | — | Legend title; default the `group` column name. |
705
+ | `title` | 'auto' | Legend title; `"auto"`: the `group` column name, if any. |
427
706
  | `font_size` | '1em' | Font size. Length; `%`: of the parent's font size. |
428
707
  | `color` | 'var(text_color)' | Text color. |
429
708
  | `background` | 'white' | Background of a framed legend. |
430
709
  | `frame_color` | '#999999' | Frame color. |
431
- | `pad` | 5.0 | Gap to the axes. Length. |
432
710
  | `frame_width` | 0.5 | Frame line width. Length. |
711
+ | `pad` | 5.0 | Gap to the axes. Length; `%`: of the axes width (across) or height (down). |
433
712
  | `frame_radius` | 0.0 | Corner radius of the frame. Length. |
434
713
  | `frame_alpha` | 1.0 | Opacity of the frame and background. |
435
714
  | `glyph_alpha` | — | Fill opacity of `box` and `circle` symbols, outlined in the opaque color; default: the series' own fill. |
436
715
  | `glyph` | 'series' | Entry symbol: as the series draws itself, or a filled `box`, a `circle` or a `line` in the series color. |
437
716
  | `orientation` | 'auto' | `horizontal`: entries side by side; `auto`: horizontal at `top`, `bottom`, `outside_top` and `outside_bottom`. |
438
- | `glyph_length` | '2em' | Width of an entry's symbol. Length; `%`: of the font size. |
717
+ | `glyph_length` | '1.4em' | Width of an entry's symbol. Length; `%`: of the font size. |
439
718
  | `row_height` | '1.35em' | Height of an entry. Length; `%`: of the font size. |
440
719
  | `glyph_gap` | '0.5em' | Gap between a symbol and its text. Length; `%`: of the font size. |
441
720
  | `column_gap` | '1em' | Gap between columns. Length; `%`: of the font size. |
@@ -445,6 +724,8 @@ candidate covers more than 2 % marked cells; else the candidate covering the few
445
724
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
446
725
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
447
726
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
727
+
728
+ Groups: `TextStyle`, `Stroke` (`frame_`), `Font`.
448
729
  <!-- /settings -->
449
730
 
450
731
  ### Decorations
@@ -474,15 +755,17 @@ HLine:
474
755
  | Setting | Default | Meaning |
475
756
  |---|---|---|
476
757
  | `color` | '#4d4d4d' | Line color. |
477
- | `line_width` | inherited (1.25) | Line width. Length. |
758
+ | `line_width` | inherited (0.75) | Line width. Length. |
478
759
  | `line_style` | 'solid' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list. Length. |
479
- | `min` | '0%' | Start: a data value, or `%` (or a length) from the start of the axes. Length; bare numbers: data units. |
480
- | `max` | '100%' | End: a data value, or `%` (or a length) from the start of the axes. Length; bare numbers: data units. |
760
+ | `min` | '0%' | Start: a data value, or `%` (or a length) from the start of the axes. Length; `%`: of the axes length along the axis; bare numbers: data units. |
761
+ | `max` | '100%' | End: a data value, or `%` (or a length) from the start of the axes. Length; `%`: of the axes length along the axis; bare numbers: data units. |
481
762
  | `name` | — | Legend entry; unset: not in the legend. |
482
763
  | `alpha` | 1.0 | Opacity. |
483
764
  | `z` | 1.0 | Drawing order among the series (default 0). |
484
765
  | `extend_limits` | False | Include the decoration in the axis limits. |
485
766
  | `clip` | True | Clip to the axes area. |
767
+
768
+ Groups: `Stroke`.
486
769
  <!-- /settings -->
487
770
 
488
771
  AxLine:
@@ -491,13 +774,15 @@ AxLine:
491
774
  | Setting | Default | Meaning |
492
775
  |---|---|---|
493
776
  | `color` | '#4d4d4d' | Line color. |
494
- | `line_width` | inherited (1.25) | Line width. Length. |
777
+ | `line_width` | inherited (0.75) | Line width. Length. |
495
778
  | `line_style` | 'solid' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list. Length. |
496
779
  | `name` | — | Legend entry; unset: not in the legend. |
497
780
  | `alpha` | 1.0 | Opacity. |
498
781
  | `z` | 1.0 | Drawing order among the series (default 0). |
499
782
  | `extend_limits` | False | Include the decoration in the axis limits. |
500
783
  | `clip` | True | Clip to the axes area. |
784
+
785
+ Groups: `Stroke`.
501
786
  <!-- /settings -->
502
787
 
503
788
  HSpan:
@@ -508,13 +793,15 @@ HSpan:
508
793
  | `color` | '#e5e5e5' | Fill color. |
509
794
  | `edge_color` | — | Outline color; default none. |
510
795
  | `edge_width` | 0.0 | Outline width. Length. |
511
- | `min` | '0%' | Start: a data value, or `%` (or a length) from the start of the axes. Length; bare numbers: data units. |
512
- | `max` | '100%' | End: a data value, or `%` (or a length) from the start of the axes. Length; bare numbers: data units. |
796
+ | `min` | '0%' | Start: a data value, or `%` (or a length) from the start of the axes. Length; `%`: of the axes length along the axis; bare numbers: data units. |
797
+ | `max` | '100%' | End: a data value, or `%` (or a length) from the start of the axes. Length; `%`: of the axes length along the axis; bare numbers: data units. |
513
798
  | `name` | — | Legend entry; unset: not in the legend. |
514
799
  | `alpha` | 1.0 | Opacity. |
515
800
  | `z` | -1.0 | Drawing order among the series (default 0). |
516
801
  | `extend_limits` | False | Include the decoration in the axis limits. |
517
802
  | `clip` | True | Clip to the axes area. |
803
+
804
+ Groups: `Stroke` (`edge_`).
518
805
  <!-- /settings -->
519
806
 
520
807
  Text:
@@ -540,6 +827,8 @@ Text:
540
827
  | `z` | 1.0 | Drawing order among the series (default 0). |
541
828
  | `extend_limits` | False | Include the decoration in the axis limits. |
542
829
  | `clip` | False | Clip to the axes area. |
830
+
831
+ Groups: `TextStyle`, `Font`.
543
832
  <!-- /settings -->
544
833
 
545
834
  Annotate:
@@ -547,22 +836,6 @@ Annotate:
547
836
  <!-- settings:Annotate -->
548
837
  | Setting | Default | Meaning |
549
838
  |---|---|---|
550
- | `rotation` | 0.0 | Rotation (degrees, counterclockwise). Angle (bare: degrees). |
551
- | `coords` | 'data' | `data`, `axes` (0–1) or `figure` (0–1). |
552
- | `color` | 'var(text_color)' | Text color; default `text_color`. |
553
- | `font_size` | inherited (11.0) | Font size. Length; `%`: of the parent's font size. |
554
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
555
- | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
556
- | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
557
- | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
558
- | `font_weight` | 'normal' | `normal`, `bold` or a weight 1–1000. |
559
- | `font_style` | 'normal' | `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
560
- | `text_color` | inherited ('black') | Text color. |
561
- | `name` | — | Legend entry; unset: not in the legend. |
562
- | `alpha` | 1.0 | Opacity. |
563
- | `z` | 1.0 | Drawing order among the series (default 0). |
564
- | `extend_limits` | False | Include the decoration in the axis limits. |
565
- | `clip` | False | Clip to the axes area. |
566
839
  | `align` | 'center' | Horizontal alignment on `xytext`. |
567
840
  | `valign` | 'center' | Vertical alignment on `xytext`. |
568
841
  | `text_coords` | 'var(coords)' | Coordinates of `xytext`: as `coords`, or `offset` (px from `xy`, y up); default `coords`. |
@@ -572,6 +845,8 @@ Annotate:
572
845
  | `arrow_width` | 0.75 | Arrow line width. Length. |
573
846
  | `head_length` | 7.0 | Arrowhead length. Length. |
574
847
  | `shrink` | 3.0 | Gap left at both ends of the arrow. Length. |
848
+
849
+ Groups: `Stroke` (`arrow_`).
575
850
  <!-- /settings -->
576
851
 
577
852
  ## 4. Axes
@@ -588,6 +863,12 @@ Annotate:
588
863
  | `logit` | log₁₀(p/(1 − p)) | 0 < p < 1 |
589
864
  | `time` | seconds since 1970-01-01 UTC | dates and times |
590
865
  | `category` | category index | categories |
866
+ | `genome` | position in bp (less the axis' `origin`) | the axis' `region` |
867
+
868
+ The genome scale is linear, its limits the axis' `region` without padding, its tick labels
869
+ in `unit` (bp, kb or Mb; `unit_in` puts the unit in the label or after each tick label),
870
+ its automatic label the chromosome; genome series set it on an x axis without a scale
871
+ ([§9](#9-genome-tracks)).
591
872
 
592
873
  Values outside the domain are missing on that axis. The three logs place data
593
874
  identically; they differ in their ticks. Box and heatmap series with labels make their
@@ -633,11 +914,15 @@ grid only when its axis asks). `p.save` includes its twins.
633
914
  `"0/max"`, `"q:0.01/q:0.99"`. Or `(lo, hi)`, `None` meaning automatic.
634
915
  * A single value is widened by ±0.5 in position space. `invert=True` reverses the axis.
635
916
  * `include_zero=True` extends automatic limits to 0 (linear and sqrt axes) before padding
636
- and `nice`; `"auto"` does so where a series on the axis asks for it, following
917
+ and `snap`; `"auto"` does so where a series on the axis asks for it, following
637
918
  Vega-Lite's default: both axes of scatter plots, the value axis of lines, areas and
638
919
  boxes, never category axes or heatmaps.
639
- * `nice=True` extends automatic limits (after padding) to the enclosing major ticks on
640
- linear and log axes, as MATLAB and Vega-Lite do; given limits stay.
920
+ * `snap` moves automatic limits (after padding) onto major ticks, on linear and log
921
+ axes; given limits stay. The default `("4%", "8%")` (`(back, out)`, `%` of the axis
922
+ length or px) extends a limit out to the next tick when it is within 8% of the axis,
923
+ or pulls it back to a tick it passed by at most 4% when that tick is still outside the
924
+ data; other limits stay as padded. `True` always extends to the enclosing ticks, as
925
+ MATLAB and Vega-Lite do; `False` leaves the padded limits.
641
926
 
642
927
  ### Ticks
643
928
 
@@ -675,52 +960,58 @@ or the plot's `spines` is set.
675
960
  <!-- settings:Axis -->
676
961
  | Setting | Default | Meaning |
677
962
  |---|---|---|
678
- | `label` | — | Axis title: a string or rich content. |
963
+ | `label` | — | Axis title: a string or rich content; `\n` starts a line in a row band. |
964
+ | `label_position` | 'axis' | Where the label of a plot's y axis goes: `axis` (beside the tick labels); in a band left of the plot, lined up with the labels of the other plots of its grid column (row labels): `band` (rotated) or `left` (horizontal, right-aligned); `inside` (top left inside the axes). |
679
965
  | `label_font_size` | '1em' | Font size of the label; default: the base font size. Length; `%`: of the font size. |
680
- | `scale` | — | `linear`, `log`, `log2`, `log10`, `sqrt`, `exp`, `symlog`, `logit`, `time` or `category`; default: `category` for categorical series, `time` for dates, else `linear`. |
966
+ | `label_weight` | 'normal' | Axis title weight: `normal`, `bold` or 1–1000. |
967
+ | `label_style` | 'normal' | Axis title style: `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
968
+ | `label_color` | 'var(color)' | Axis title color. |
969
+ | `scale` | — | `linear`, `log`, `log2`, `log10`, `sqrt`, `exp`, `symlog`, `logit`, `time`, `category` or `genome`; default: `category` for categorical series, `time` for dates, `genome` for genome series, else `linear`. |
970
+ | `region` | — | Genome scale: the region drawn, its limits: `"chr2:143,120,001-143,780,000"` (1-based, inclusive), `(chr, start, end)` (0-based, half-open) or a mapping; genome series read it. |
971
+ | `unit` | 'auto' | Genome scale: unit of the tick labels; `auto`: with ticks about a fifth of the span apart, the largest unit in which they are at least 1 apart and at most 1000, else the largest in which they are at most 1000 with at most 3 decimals, else bp. |
972
+ | `unit_in` | 'label' | Genome scale: where the unit is written, in the axis label (`chr2 (Mb)`) or after each tick label (`500kb`). |
973
+ | `origin` | — | The value drawn at 0 for the axis' series (a series' own `x_origin` wins): a number, or `"center"`, `"start"`, `"end"` of the region (genome scale), else of each series' range. Values are drawn at `(v − origin) × x_scale`; limits, ticks and decorations are in the drawn units. |
681
974
  | `linthresh` | 1.0 | Half-width of the linear region of a `symlog` axis. |
682
975
  | `tz` | — | Time zone of a time axis (a `tzinfo`); default: the zone of the first aware date, else naive (UTC). |
683
- | `limits` | 'auto' | `"auto"`, `"lo/hi"` (`min`, `max`, numbers, `q:F`) or `(lo, hi)`. |
684
- | `padding` | 'auto' | Space added to automatic limits, as a fraction of the range; `"auto"`: `auto_padding`, or 0 on axes of series drawn to exact limits (box value axes, heatmaps, …) and in plots without axes. Length. |
685
- | `auto_padding` | '5%' | The fraction `padding="auto"` adds on each side. Length. |
976
+ | `limits` | 'auto' | `"auto"`, `"lo/hi"` or `[lo, hi]` (a tuple too); each side a number, `"min"`, `"max"`, `"q:F"` (a quantile), a date, or `"auto"`/`None`: `"0/max"` is `[0, "max"]`. |
977
+ | `padding` | 'auto' | Space added to automatic limits, as a fraction of the range; `"auto"`: `auto_padding`, or 0 on axes of series drawn to exact limits (box value axes, heatmaps, …) and in plots without axes. Length; `%`: of the axis range. |
978
+ | `auto_padding` | '5%' | The fraction `padding="auto"` adds on each side. Length; `%`: of the axis range. |
979
+ | `sticky` | True | No padding past the baseline of bars and histograms when an automatic limit is on it (matplotlib's sticky edges). |
686
980
  | `invert` | False | Reverse the axis. |
687
981
  | `ticks` | — | `False` (no ticks) or a list of tick values. |
688
982
  | `tick_labels` | — | Labels of `ticks`. |
689
983
  | `minor_ticks` | — | `True`, `False` or a list of values; default: on for log10. |
690
- | `tick_format` | 'auto' | Number format: `auto`, `percent`, `sci`, `eng`, `si`, `int`, a format string or a function. |
984
+ | `tick_format` | 'auto' | Number format: `auto`, `percent`, `sci`, `eng`, `si`, `int`, a format string or a function; on a genome axis also `chr:pos` (`chr2:143,250,000`). |
691
985
  | `tick_rotation` | 'auto' | Label rotation in degrees, or `"auto"` (45° when category labels overlap). Angle (bare: degrees). |
692
986
  | `max_ticks` | 'auto' | Most major ticks; `"auto"`: one per `tick_spacing` of axis length, at least 2, at most `auto_max_ticks`. |
693
- | `tick_spacing` | ('3em', '2em') | Space per automatic tick, in tick label font sizes, on horizontal and vertical axes. Length; `em` and `%`: of `tick_font_size`. |
694
- | `time_tick_spacing` | ('5em', '2.5em') | `tick_spacing` of time axes. Length; `em` and `%`: of `tick_font_size`. |
695
- | `tick_label_gap` | '0.6em' | Smallest gap between neighbouring tick labels side by side: fewer numeric ticks, or category labels rotated and thinned out, below it. Length; `em` and `%`: of `tick_font_size`. |
696
- | `category_label_spacing` | ('1.6em', '1.3em') | Distance between category labels: rotated (horizontal axes) and stacked (vertical axes); labels closer than it are thinned out. Length; `em` and `%`: of `tick_font_size`. |
987
+ | `tick_spacing` | ('3em', '2em') | Space per automatic tick, in tick label font sizes, on horizontal and vertical axes. Length; `em` and `%`: of `tick_label_font_size`. |
988
+ | `time_tick_spacing` | ('5em', '2.5em') | `tick_spacing` of time axes. Length; `em` and `%`: of `tick_label_font_size`. |
989
+ | `tick_label_gap` | '0.6em' | Smallest gap between neighbouring tick labels side by side: fewer numeric ticks, or category labels rotated and thinned out, below it. Length; `em` and `%`: of `tick_label_font_size`. |
990
+ | `category_label_spacing` | ('1.6em', '1.3em') | Distance between category labels: rotated (horizontal axes) and stacked (vertical axes); labels closer than it are thinned out. Length; `em` and `%`: of `tick_label_font_size`. |
697
991
  | `auto_max_ticks` | (10, 8) | Most automatic ticks on numeric and time axes. |
698
992
  | `sci_limits` | (-4, 5) | Exponents beyond which labels become mantissas × 10ᵏ. |
699
- | `tick_length` | 6.0 | Tick length. Length; `%`: of the axes side across the axis. |
993
+ | `tick_length` | 5.0 | Tick length. Length; `%`: of the axes side across the axis. |
700
994
  | `minor_tick_length` | '60%' | Minor tick length; default 0.6 × `tick_length`. Length; `%`: of `tick_length`. |
701
995
  | `tick_direction` | 'out' | `out`, `in` or `both`. |
996
+ | `tick_color` | 'var(color)' | Tick color. |
702
997
  | `tick_width` | 0.75 | Tick line width. Length. |
703
- | `tick_font_size` | '1em' | Font size of tick labels. Length; `%`: of the font size. |
998
+ | `tick_label_font_size` | '1em' | Font size of tick labels. Length; `%`: of the font size. |
999
+ | `tick_label_weight` | 'normal' | Tick label weight: `normal`, `bold` or 1–1000. |
1000
+ | `tick_label_color` | 'var(color)' | Tick label color. |
704
1001
  | `tick_pad` | 3.0 | Gap between ticks and labels. Length; `%`: of the axes side across the axis. |
705
1002
  | `label_pad` | 4.0 | Gap between tick labels and the label. Length; `%`: of the axes side across the axis. |
706
1003
  | `color` | 'var(text_color)' | Color of the axis line, ticks and labels (the default of `line_color`, `tick_color`, `tick_label_color`, `label_color`). |
707
1004
  | `line_color` | 'var(color)' | Axis line color. |
708
- | `tick_color` | 'var(color)' | Tick color. |
709
- | `tick_label_color` | 'var(color)' | Tick label color. |
710
- | `label_color` | 'var(color)' | Axis title color. |
711
- | `label_weight` | 'normal' | Axis title weight: `normal`, `bold` or 1–1000. |
712
- | `label_style` | 'normal' | Axis title style: `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
1005
+ | `line_width` | 0.75 | Axis line width. Length. |
713
1006
  | `side` | x: 'bottom' / y: 'left' | Where the ticks, labels and axis line go: `bottom` or `top` (x axis), `left` or `right` (y axis). |
714
- | `tick_label_weight` | 'normal' | Tick label weight: `normal`, `bold` or 1–1000. |
715
1007
  | `mirror` | False | Ticks also on the opposite side of the axes. |
716
1008
  | `spine_offset` | 0.0 | Distance the axis line (with its ticks and labels) is moved away from the axes. Length; `%`: of the axes side across the axis. |
717
1009
  | `spine_trim` | False | Axis line from the first to the last major tick only. |
718
- | `include_zero` | False | Extend automatic limits to 0 (linear and sqrt scales), before padding and `nice`: `True`, or `"auto"` where a series on the axis asks for it (Vega-Lite's rule: scatter axes, the value axis of lines, areas and boxes). |
1010
+ | `include_zero` | False | Extend automatic limits to 0 (linear and sqrt scales), before padding and `snap`: `True`, or `"auto"` where a series on the axis asks for it (Vega-Lite's rule: scatter axes, the value axis of lines, areas and boxes). |
719
1011
  | `zero_line` | False | A line across the plot at 0. |
720
1012
  | `zero_line_color` | 'var(line_color)' | Zero line color; default `line_color`. |
721
1013
  | `zero_line_width` | 'var(line_width)' | Zero line width; default `line_width`. Length. |
722
- | `nice` | False | Extend automatic limits to the enclosing major ticks (linear and log scales). |
723
- | `line_width` | 0.75 | Axis line width. Length. |
1014
+ | `snap` | ('4%', '8%') | Automatic limits on major ticks (linear and log scales): `True`, out to the enclosing ticks; `(back, out)`, out to a tick within `out` (`%` of the axis), or back to one within `back` that is still outside the data; `False`: as padded. Length; `%`: of the axis range. |
724
1015
  | `grid` | False | Major grid lines across the plot. |
725
1016
  | `grid_color` | '#dddddd' | Grid line color. |
726
1017
  | `grid_width` | 0.5 | Grid line width. Length. |
@@ -742,6 +1033,8 @@ or the plot's `spines` is set.
742
1033
  | `prefix` | inherited ('') | Text before every number. |
743
1034
  | `suffix` | inherited ('') | Text after every number. |
744
1035
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1036
+
1037
+ Groups: `TextStyle` (`label_`), `Stroke` (`tick_`), `TextStyle` (`tick_label_`), `Stroke` (`line_`), `Stroke` (`zero_line_`), `Stroke` (`grid_`), `Stroke` (`minor_grid_`), `Font`, `NumberFormat`.
745
1038
  <!-- /settings -->
746
1039
 
747
1040
  ## 5. Series
@@ -750,17 +1043,56 @@ All series take `name`, `alpha`, `z`, `rasterize` and `simplify` (see [Output](#
750
1043
  Series without their own color take the plot's next palette color, in call order; series
751
1044
  with several value sets (histograms, densities, areas, pies) take one per set.
752
1045
 
1046
+ * **Layers.** A series is a preset of layers: each a stat (columns computed from the
1047
+ data: bins, densities, quartiles, fits, contours…), a position (stack, dodge, jitter,
1048
+ swarm, rows of intervals), and one of eight geoms that draws the columns (points,
1049
+ paths, bands, rectangles, polygons, segments, cells, text). A box plot is rectangles,
1050
+ segments and points from one box stat; it has one legend entry. Positions run once per
1051
+ plot over all its series, before the axes are fitted.
1052
+ * **Orientation.** Every series with x and y data takes `orientation="horizontal"`
1053
+ (scatter, line, fill, area, bar, hist, kde, ecdf, box, violin, strip, swarm, errorbar,
1054
+ stem, regression): its x data go along the y axis, its y data along the x axis, and it
1055
+ draws the same marks with x and y swapped (curves along y, steps included). Grids
1056
+ (heatmap, hist2d, hexbin, contour, 2-D kde) and pies have none: swap their arguments.
1057
+ * **New types.** `pl.register_layer(name, factory)` adds `plot.<name>(…)`, which calls
1058
+ `factory(…, plot=plot)`. A factory that is a `pl.Series` subclass implements
1059
+ `layers()`, returning its `Call` (layers, legend entries, what the axes, maps and
1060
+ palette need; see `plot_io/layers/`); its class name is a style class. The genome types
1061
+ are registered so (`plot.bigwig(…)`, …).
1062
+
753
1063
  * **Category slots.** Box and violin series, bar series, and strip and swarm series form
754
1064
  three dodge groups: the series of a group that have a category split its slot (`width`)
755
1065
  side by side, in call order; `dodge=False` overlays a series; `gap` leaves part of each
756
- share empty (`"10%"`). `width` is in data units (`0.8` is 80 % of a category) or `%` of
757
- the slot: one category, or the smallest gap between numeric `positions`. Stacked bars count as one, and so do split violins.
1066
+ share empty (`"10%"`). `width` is a `%` of the slot (one category, or the smallest gap
1067
+ between numeric `positions`), a length (px), or data units (`"0.8d"`). Stacked bars
1068
+ count as one, and so do split violins.
758
1069
  * **Stacking.** `stack=True` (bars, histograms, densities) puts a series on the previous
759
1070
  stacked series of its kind in the plot, per category or bin; positive and negative
760
1071
  values stack apart; `stack="normalize"` divides each position by its total.
761
1072
  * **Derived data.** Histograms, densities, ECDFs, violins, 2-D bins, contours and
762
- regressions compute their data once (in C, by pdf_io's array helpers) and keep it until
1073
+ regressions compute their data once (in C, by plot_io's kernels) and keep it until
763
1074
  a setting changes; `series.stats` exposes it.
1075
+ * **Shifted and rescaled coordinates.** `x_origin`, `x_scale` and `x_extent` (and `y_…`)
1076
+ draw a series' values `v` at `(v − origin) × scale`, without changing the data:
1077
+ `p.line(profile, x_origin="center")` draws positions 0…1000 at −500…500, `x_scale=10`
1078
+ makes bins of 10 (−5000…5000), and `x_extent="-5000/5000"` maps the series' smallest x
1079
+ to −5000 and its largest to 5000 (replacing origin and scale). `"center"` is the middle
1080
+ of the series' range, `"start"`/`"end"` its smallest/largest value. Limits, ticks and
1081
+ decorations (`p.vline(0)`) are in the drawn units. An axis' `origin`
1082
+ (`p.x_axis(origin="center")`, `fig.x_axis(…)` for every plot) applies to every series on
1083
+ it that has no `x_origin` of its own (on a genome axis, `"center"` is the middle of its
1084
+ region). Category axes ignore them, and they need a linear, time or genome axis.
1085
+
1086
+ <!-- settings:Transforms -->
1087
+ | Setting | Default | Meaning |
1088
+ |---|---|---|
1089
+ | `x_origin` | — | The x value drawn at 0: a number, `"center"` (the middle of the series' x range), `"start"` or `"end"` (its smallest or largest x); unset: the x axis' `origin`. Values are drawn at `(x − x_origin) × x_scale`. |
1090
+ | `x_scale` | 1.0 | Factor on x values after `x_origin` (e.g. bp per bin); default 1. |
1091
+ | `x_extent` | — | The span the series' x range is drawn over, `"lo/hi"` or `[lo, hi]`: its smallest x at `lo`, its largest at `hi`; replaces `x_origin` and `x_scale`. |
1092
+ | `y_origin` | — | The y value drawn at 0: a number, `"center"` (the middle of the series' y range), `"start"` or `"end"` (its smallest or largest y); unset: the y axis' `origin`. Values are drawn at `(y − y_origin) × y_scale`. |
1093
+ | `y_scale` | 1.0 | Factor on y values after `y_origin` (e.g. bp per bin); default 1. |
1094
+ | `y_extent` | — | The span the series' y range is drawn over, `"lo/hi"` or `[lo, hi]`: its smallest y at `lo`, its largest at `hi`; replaces `y_origin` and `y_scale`. |
1095
+ <!-- /settings -->
764
1096
 
765
1097
  ### Tables (`data=`)
766
1098
 
@@ -774,7 +1106,7 @@ p = pl.Plot(data=df); p.scatter("a", "b") # data inherited by the plot's s
774
1106
  or polars data frame, a numpy structured array. Columns are read through `__getitem__`
775
1107
  (and `to_numpy()` when present); no table library is imported. With `data`, a string in
776
1108
  a positional data argument or in `color`, `edge_color`, `size`, `alpha`, `group`,
777
- `order`, `x_error`, `y_error`, `weights`, `positions`, `x`, `y` or `labels` names a
1109
+ `draw_order`, `x_error`, `y_error`, `weights`, `positions`, `x`, `y` or `names` names a
778
1110
  column. Positional arguments, `group`, `weights` and `positions` must be columns; in
779
1111
  `color`, a color name that is no column stays a color (a column wins, with a warning if
780
1112
  the name is also a color). Axis titles default to the column names drawn on the axes,
@@ -802,7 +1134,7 @@ groups. Missing labels (`None`, NaN) form a `"nan"` group, or are dropped with
802
1134
  `group_missing="drop"`. `set()` on the group applies to every member; `group[label]` (or
803
1135
  an index) is one member; `labels` lists them. For box, violin, bar, strip and swarm the
804
1136
  groups are dodged within each category slot. Densities (`"density"`) are computed per
805
- member, and `order` sorts within each member.
1137
+ member, and `draw_order` sorts within each member.
806
1138
 
807
1139
  ### Scatter
808
1140
 
@@ -825,30 +1157,39 @@ the style's map); numbers in `size` are diameters, or values mapped through `siz
825
1157
  | Setting | Default | Meaning |
826
1158
  |---|---|---|
827
1159
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
828
- | `size` | 5.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1160
+ | `size` | 4.5 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
829
1161
  | `color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
830
- | `edge_color` | — | Outline: as the fill color. |
831
- | `edge_width` | 0.5 | Outline width. Length. |
832
- | `filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1162
+ | `edge_color` | 'auto' | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1163
+ | `edge_width` | 0.75 | Outline width; 0: no outline. Length. |
1164
+ | `fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
833
1165
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
834
- | `color_map` | inherited ('rainbow_llhh') | How numbers in `color` become colors: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
835
- | `size_map` | — | How numbers in `size` become sizes: a `SizeMap` (alias `smap`); without it, numbers are sizes in px. |
836
- | `size_legend` | True | With a `size_map`: a size key in the legend (`True`), none (`False`), or the values to show (a list). |
837
- | `order` | — | Drawing order: `"density"` (densest drawn last), `"-density"`, or sort keys per point (ascending); default: call order. |
1166
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1167
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1168
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1169
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1170
+ | `size_map` | — | The sizes numbers in `size` are drawn with: a `SizeMap` (alias `smap`); without it (or `size_axis`), numbers are sizes in px. |
1171
+ | `size_limits` | — | Limits of the series' size axis, as an axis' `limits`; unset: `"auto"`. |
1172
+ | `size_scale` | — | Scale of the series' size axis; unset: `linear`. |
1173
+ | `size_axis` | — | A shared `SizeAxis` (`figure.size_axis(…)`) in place of the series' own: it holds the sizes, limits and scale. |
1174
+ | `size_legend` | True | With mapped sizes: a size key in the legend (`True`), none (`False`), or the values to show (a list). |
1175
+ | `draw_order` | — | Drawing order: `"density"` (densest drawn last), `"-density"`, or sort keys per point (ascending); default: call order. |
838
1176
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own; or `"density"` / a `Density`, mapped linearly to `alpha_range`. |
839
1177
  | `alpha_range` | (0.2, 1.0) | Opacities of the least and most dense points when `alpha` is a density. |
840
1178
  | `x_error` | — | Horizontal error bars: a value, a sequence, `(low, high)` or `ErrorBars`. |
841
1179
  | `y_error` | — | Vertical error bars. |
1180
+ | `orientation` | 'vertical' | `vertical` (x along the x axis) or `horizontal` (x along the y axis). |
842
1181
  | `name` | — | Legend entry; unset: not in the legend. |
843
1182
  | `z` | — | Drawing order (higher on top); default: call order. |
844
1183
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
845
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1184
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1185
+ | `text_color` | inherited ('black') | Text color. |
846
1186
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
847
1187
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
848
- | `text_color` | inherited ('black') | Text color. |
849
1188
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
850
1189
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
851
1190
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1191
+
1192
+ Groups: `Marker`, `Font`.
852
1193
  <!-- /settings -->
853
1194
 
854
1195
  ### Line
@@ -859,11 +1200,16 @@ pl.Line(x, y=None, plot=None, **settings) # y 2-D: one line per row; x omitte
859
1200
 
860
1201
  Named line styles scale with the width. Markers (`marker`, `marker_size`,
861
1202
  `marker_color`, …) are drawn at the points when `marker` or `show_markers` is set.
1203
+ Numbers per point (or `"density"`, of a single line) in `marker_color` and
1204
+ `marker_edge_color` go through the series' [color axis](#6-color-and-size-axes)
1205
+ (`color_map`, `color_limits`, `color_scale`, `color_axis`; `p.colorbar(line)`), as
1206
+ `color` does on Scatter; the line keeps `color`, and the legend's marker takes the
1207
+ gradient's middle color.
862
1208
 
863
1209
  * `interpolation`: `linear`; `step-pre`, `step-post`, `step-mid`; `monotone` (a cubic
864
1210
  through every point that never overshoots, Fritsch–Carlson; `spline` where x is not
865
1211
  monotonic); `spline` (centripetal Catmull–Rom, may overshoot). Each segment is one exact
866
- Bézier, computed on the page after the axis scales, by pdf_io in C. Steps and curves
1212
+ Bézier, computed on the page after the axis scales, by vec_io in C. Steps and curves
867
1213
  are not decimated by `simplify`.
868
1214
  * `missing`: `break` (default) ends a run at a missing value (NaN, `None`, or outside the
869
1215
  axis scale's domain); runs are drawn on their own and a one-point run draws nothing.
@@ -873,33 +1219,40 @@ Named line styles scale with the width. Markers (`marker`, `marker_size`,
873
1219
  | Setting | Default | Meaning |
874
1220
  |---|---|---|
875
1221
  | `color` | — | Line color; default: the next palette color. |
876
- | `line_width` | inherited (1.25) | Line width. Length. |
1222
+ | `line_width` | inherited (0.75) | Line width. Length. |
877
1223
  | `line_style` | 'solid' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list; named styles scale with the width. Length. |
878
- | `interpolation` | 'linear' | How points are joined: `linear`, `step-pre`, `step-post`, `step-mid`, `monotone` (a curve that never overshoots) or `spline` (centripetal Catmull–Rom). |
879
- | `missing` | 'break' | Missing values: `break` the line there, or `skip` them and connect their neighbours. |
880
1224
  | `cap` | 'butt' | Line cap. |
881
1225
  | `join` | 'round' | Line join. |
1226
+ | `interpolation` | 'linear' | How points are joined: `linear`, `step-pre`, `step-post`, `step-mid`, `monotone` (a curve that never overshoots) or `spline` (centripetal Catmull–Rom). |
1227
+ | `missing` | 'break' | Missing values: `break` the line there, or `skip` them and connect their neighbours. |
882
1228
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
883
- | `marker_size` | 5.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1229
+ | `marker_size` | 4.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
884
1230
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
885
- | `marker_edge_color` | — | Outline: as the fill color. |
886
- | `marker_edge_width` | 0.5 | Outline width. Length. |
887
- | `marker_filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1231
+ | `marker_edge_color` | 'auto' | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1232
+ | `marker_edge_width` | 0.75 | Outline width; 0: no outline. Length. |
1233
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
888
1234
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1235
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1236
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1237
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1238
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
889
1239
  | `x_error` | — | Horizontal error bars at the points. |
890
1240
  | `y_error` | — | Vertical error bars at the points. |
891
1241
  | `show_markers` | False | Draw markers at the points (also turned on by setting `marker`). |
1242
+ | `orientation` | 'vertical' | `vertical` (x along the x axis) or `horizontal` (x along the y axis). |
892
1243
  | `name` | — | Legend entry; unset: not in the legend. |
893
1244
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
894
1245
  | `z` | — | Drawing order (higher on top); default: call order. |
895
1246
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
896
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1247
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1248
+ | `text_color` | inherited ('black') | Text color. |
897
1249
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
898
1250
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
899
- | `text_color` | inherited ('black') | Text color. |
900
1251
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
901
1252
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
902
1253
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1254
+
1255
+ Groups: `Stroke`, `Marker` (`marker_`), `Font`.
903
1256
  <!-- /settings -->
904
1257
 
905
1258
  ### Fill
@@ -909,14 +1262,17 @@ pl.Fill(x, y1, y2=0, plot=None, **settings) # y1 may be two rows [upper, lower
909
1262
  ```
910
1263
 
911
1264
  `interpolation` and `missing` work as for lines, on both edges (a point is missing when
912
- x, y1 or y2 is), so a band with the settings of its line matches it. With
913
- `orientation="horizontal"`, curves are drawn as straight segments.
1265
+ x, y1 or y2 is), so a band with the settings of its line matches it, horizontal ones
1266
+ included (`fill(y, x1, x2, orientation="horizontal")`: the curves run along y).
1267
+ `color_below` colors the parts where `y1` is below `y2` (a difference between two curves,
1268
+ each side in its color).
914
1269
 
915
1270
  <!-- settings:Fill -->
916
1271
  | Setting | Default | Meaning |
917
1272
  |---|---|---|
918
1273
  | `color` | — | Fill color; default: the next palette color. |
919
- | `alpha` | 'calc(0.3 * var(alpha))' | Opacity; default 0.3. |
1274
+ | `color_below` | — | Fill color where `y1` is below `y2` (crossings found on straight segments); default `color` everywhere. |
1275
+ | `alpha` | 'calc(0.3 * inherit)' | Opacity; default 0.3 × the plot's. |
920
1276
  | `edge_color` | — | Outline color; default none. |
921
1277
  | `edge_width` | 'var(line_width)' | Outline width; default the line width. Length. |
922
1278
  | `interpolation` | 'linear' | How points are joined: `linear`, `step-pre`, `step-post`, `step-mid`, `monotone` (a curve that never overshoots) or `spline` (centripetal Catmull–Rom). |
@@ -925,13 +1281,15 @@ x, y1 or y2 is), so a band with the settings of its line matches it. With
925
1281
  | `name` | — | Legend entry; unset: not in the legend. |
926
1282
  | `z` | — | Drawing order (higher on top); default: call order. |
927
1283
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
928
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1284
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1285
+ | `text_color` | inherited ('black') | Text color. |
929
1286
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
930
1287
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
931
- | `text_color` | inherited ('black') | Text color. |
932
1288
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
933
1289
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
934
1290
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1291
+
1292
+ Groups: `Stroke` (`edge_`), `Font`.
935
1293
  <!-- /settings -->
936
1294
 
937
1295
  ### Box
@@ -952,44 +1310,51 @@ category.
952
1310
  | Setting | Default | Meaning |
953
1311
  |---|---|---|
954
1312
  | `color` | — | Box fill: a color, one per box (list or dict by category), or numbers per box (list or dict) mapped through `color_map`; default: the next palette color. |
955
- | `color_map` | inherited ('rainbow_llhh') | How numbers in `color` become colors: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
956
- | `edge_color` | 'black' | Box outline, whiskers, caps and median: a color, `"series"` (each box's own color) or `"auto"` (a grey 0.6 × as light as the series' lightest color, as seaborn). |
957
- | `whisker_color` | — | Whisker and cap color; default `edge_color`. |
958
- | `whisker_style` | 'solid' | Whisker line style: `solid`, `dashed`, `dotted`, `dashdot` or a dash list (caps stay solid). Length. |
1313
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1314
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1315
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1316
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1317
+ | `edge_color` | 'series' | Box outline, whiskers, caps and median: a color, `"series"` (each box's own color) or `"auto"` (a grey 0.6 × as light as the series' lightest color, as seaborn). |
959
1318
  | `edge_width` | 0.75 | Outline width. Length. |
1319
+ | `whisker_color` | — | Whisker and cap color; default `edge_color`. |
960
1320
  | `whisker_width` | 'var(edge_width)' | Whisker and cap width; default `edge_width`. Length. |
1321
+ | `whisker_style` | 'solid' | Whisker line style: `solid`, `dashed`, `dotted`, `dashdot` or a dash list (caps stay solid). Length. |
961
1322
  | `median_color` | — | Median line color; default `edge_color`. |
962
- | `median_width` | 1.5 | Median line width. Length. |
963
- | `width` | 0.8 | Width of a category's slot (category units). Length; bare numbers: data units. |
964
- | `cap_length` | '50%' | Whisker cap width (`%` of the box width). Length. |
1323
+ | `median_width` | 'calc(3 * var(edge_width))' | Median line width. Length. |
1324
+ | `max_width` | '60%' | Largest width of the series' part of a slot (as `width`); default none. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1325
+ | `width` | '80%' | Box width: `%` of the slot, a length (bare numbers: px), `d` data units, or a duration on time axes. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1326
+ | `cap_length` | '50%' | Whisker cap width (`%` of the box width). Length; `%`: of the box width. |
965
1327
  | `whiskers` | 1.5 | Whisker reach: a multiple of the IQR, `"range"`, or percentiles `(lo, hi)`. |
966
1328
  | `outliers` | True | Draw points beyond the whiskers. |
967
1329
  | `saturation` | 1.0 | Saturation of the box fills (1: the colors as given; seaborn uses 0.75). |
1330
+ | `fill` | 0.25 | Box fill: an opacity of the box color, times `alpha` (lines keep `alpha`); `True` (opaque), a color, or `False`. |
968
1331
  | `mean` | False | Draw the mean as a marker. |
969
1332
  | `mean_marker` | 'diamond' | Marker of the mean. |
970
1333
  | `mean_color` | 'white' | Fill of the mean marker (outline: `edge_color`). |
971
1334
  | `orientation` | 'vertical' | `vertical` (categories on x) or `horizontal`. |
972
1335
  | `dodge` | True | Box and violin series sharing a category share its slot side by side; `False` overlays them. |
973
- | `gap` | '10%' | Fraction of each box's part of a shared slot left empty. Length. |
1336
+ | `gap` | '10%' | Fraction of each box's part of a shared slot left empty. Length; `%`: of each series' part of a shared slot. |
974
1337
  | `categories` | — | Category names of a list of arrays. |
975
1338
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
976
- | `marker_size` | 4.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
977
- | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
978
- | `marker_edge_color` | — | Outline: as the fill color. |
979
- | `marker_edge_width` | 0.5 | Outline width. Length. |
980
- | `marker_filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1339
+ | `marker_size` | 3.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1340
+ | `marker_color` | — | Outlier fill: a color, or colors per outlier. |
1341
+ | `marker_edge_color` | — | Outlier outline: as the fill, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1342
+ | `marker_edge_width` | 0.5 | Outline width; 0: no outline. Length. |
1343
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
981
1344
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
982
1345
  | `name` | — | Legend entry; unset: not in the legend. |
983
1346
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
984
1347
  | `z` | — | Drawing order (higher on top); default: call order. |
985
1348
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
986
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1349
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1350
+ | `text_color` | inherited ('black') | Text color. |
987
1351
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
988
1352
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
989
- | `text_color` | inherited ('black') | Text color. |
990
1353
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
991
1354
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
992
1355
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1356
+
1357
+ Groups: `Stroke` (`edge_`), `Stroke` (`whisker_`), `Stroke` (`median_`), `FillStyle`, `Marker` (`marker_`), `Font`.
993
1358
  <!-- /settings -->
994
1359
 
995
1360
  ### Heatmap
@@ -1000,34 +1365,35 @@ pl.Heatmap(values, x=None, y=None, plot=None, **settings)
1000
1365
 
1001
1366
  `values` is 2-D, row 0 first; a 3-D `(h, w, 3|4)` grid is drawn as colors. `x`/`y`:
1002
1367
  `None` (cell indices), labels (a category axis), n cell centres or n + 1 edges (uneven
1003
- spacing and any axis scale allowed). `cmap` takes a `ColorMap` or what `ColorMap()`
1004
- takes; `color_limits` and `color_scale` override its limits and scale for this series.
1005
- `labels=True` writes each value, formatted by `label_format` (any
1368
+ spacing and any axis scale allowed). `color_map` (alias `cmap`), `color_limits` and
1369
+ `color_scale` configure the series' [color axis](#6-color-and-size-axes).
1370
+ `value_labels=True` writes each value, formatted by `value_label_format` (any
1006
1371
  [number format](#number-formats); `"auto"`: 3 significant digits, the same decimals for
1007
1372
  all cells), in black or white, whichever contrasts more (at most 2,500 cells unless
1008
- `labels="all"`).
1373
+ `value_labels="all"`). `kind`: `image`, `cells` or `smooth`.
1009
1374
 
1010
1375
  <!-- settings:Heatmap -->
1011
1376
  | Setting | Default | Meaning |
1012
1377
  |---|---|---|
1013
- | `color_map` | inherited ('rainbow_llhh') | A `ColorMap`, a map name or a list of colors. |
1014
- | `color_limits` | — | Override of the map's limits for this series. |
1015
- | `color_scale` | — | Override of the map's scale. |
1016
- | `mode` | 'image' | `image` (one image pixel per cell), `cells` (rectangles) or `smooth` (interpolated). |
1378
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1379
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1380
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1381
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1382
+ | `kind` | 'image' | `image` (one image pixel per cell), `cells` (rectangles) or `smooth` (interpolated). |
1017
1383
  | `nan_color` | — | Color of missing cells; default: the map's `bad` (transparent). |
1018
1384
  | `origin` | 'top' | `top`: row 0 at the top (y axis inverted); `bottom`: at the bottom. |
1019
- | `labels` | False | Write each cell's value (`"all"` above 2,500 cells). |
1020
- | `label_format` | 'auto' | Number format of cell labels (`auto`: 3 significant digits, the same decimals for all cells). |
1021
- | `label_font_size` | '0.9em' | Font size of cell labels. Length; `%`: of the font size. |
1385
+ | `value_labels` | False | Write each cell's value (`"all"` above 2,500 cells). |
1386
+ | `value_label_format` | 'auto' | Number format of cell labels (`auto`: 3 significant digits, the same decimals for all cells). |
1387
+ | `value_label_font_size` | '0.9em' | Font size of cell labels. Length; `%`: of the font size. |
1022
1388
  | `colorbar` | False | Attach a colorbar to the plot. |
1023
1389
  | `name` | — | Legend entry; unset: not in the legend. |
1024
1390
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1025
1391
  | `z` | — | Drawing order (higher on top); default: call order. |
1026
1392
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1027
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1393
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1394
+ | `text_color` | inherited ('black') | Text color. |
1028
1395
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1029
1396
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1030
- | `text_color` | inherited ('black') | Text color. |
1031
1397
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1032
1398
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1033
1399
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
@@ -1037,6 +1403,8 @@ all cells), in black or white, whichever contrasts more (at most 2,500 cells unl
1037
1403
  | `prefix` | inherited ('') | Text before every number. |
1038
1404
  | `suffix` | inherited ('') | Text after every number. |
1039
1405
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1406
+
1407
+ Groups: `TextStyle` (`value_label_`), `Font`, `NumberFormat`.
1040
1408
  <!-- /settings -->
1041
1409
 
1042
1410
  ### Bar
@@ -1045,35 +1413,41 @@ all cells), in black or white, whichever contrasts more (at most 2,500 cells unl
1045
1413
  pl.Bar(x, height=None, plot=None, **settings)
1046
1414
  ```
1047
1415
 
1048
- `x`: categories (a category axis) or numbers (bars centred on them, `width` in data units); a dict `{category: height}`; or heights alone (at 0, 1, …). `labels` writes the values outside, inside or at the centre of the bars, formatted by `label_format`; `error` adds error bars at the bar ends. Value axes include 0 (`include_zero="auto"`).
1416
+ `x`: categories (a category axis) or numbers (bars centred on them, `width` in data units); a dict `{category: height}`; or heights alone (at 0, 1, …). `value_labels` writes the values outside, inside or at the centre of the bars, formatted by `value_label_format`; `fill` is the opacity of the bars' fill (or a color); `error` adds error bars at the bar ends. Value axes include 0 (`include_zero="auto"`).
1049
1417
 
1050
1418
  <!-- settings:Bar -->
1051
1419
  | Setting | Default | Meaning |
1052
1420
  |---|---|---|
1053
1421
  | `color` | — | Bar fill: a color, one per bar (list or dict by category), or numbers per bar (list or dict) mapped through `color_map`; default: the next palette color. |
1054
- | `color_map` | inherited ('rainbow_llhh') | How numbers in `color` become colors: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1055
- | `edge_color` | — | Outline color; default none. |
1056
- | `edge_width` | 0.0 | Outline width. Length. |
1057
- | `width` | 0.8 | Bar width: a category's slot (category units) or data units (a `timedelta` on time axes). Length; bare numbers: data units. |
1422
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1423
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1424
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1425
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1426
+ | `edge_color` | 'series' | Outline color: a color, `"series"` (each bar's own color, at `alpha`) or none. |
1427
+ | `edge_width` | 'var(line_width)' | Outline width. Length. |
1428
+ | `fill` | 0.25 | Fill: an opacity of each bar's color, times `alpha` (outlines keep `alpha`); `True` (opaque), a color, or `False`. |
1429
+ | `seam_color` | 'white' | Where outlined bars touch (dodged or adjacent), the shared edge in this color; `none`: both outlines as drawn. Between the parts of a stack, the line is the outline of the part nearer the baseline. |
1430
+ | `max_width` | — | Largest width of the series' part of a slot (as `width`); default none. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1431
+ | `width` | '80%' | Bar width: `%` of the slot, a length (bare numbers: px), `d` data units, or a duration (or `timedelta`) on time axes. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1058
1432
  | `bottom` | 0.0 | Base of the bars: a value or one per bar. |
1059
1433
  | `orientation` | 'vertical' | `vertical` (bars rise from the x axis) or `horizontal`. |
1060
1434
  | `stack` | False | `True`: on top of the previous stacked bars of the plot; `"normalize"`: stacks scaled to 1. |
1061
1435
  | `dodge` | True | Bar series sharing a category share its slot side by side; `False` overlays them. |
1062
- | `gap` | 0.0 | Fraction of each bar's part of a shared slot left empty. Length. |
1436
+ | `gap` | 0.0 | Fraction of each bar's part of a shared slot left empty. Length; `%`: of each series' part of a shared slot. |
1063
1437
  | `saturation` | 1.0 | Saturation of the fills (seaborn: 0.75). |
1064
1438
  | `error` | — | Error bars at the bar ends: a value, a sequence, `(low, high)` or `ErrorBars`. |
1065
1439
  | `error_color` | '#333333' | Error bar color. |
1066
1440
  | `error_width` | 0.75 | Error bar line width. Length. |
1067
- | `labels` | False | Value labels: `True`/`"outside"`, `"inside"`, `"center"`. |
1068
- | `label_format` | 'auto' | Number format of the labels. |
1441
+ | `value_labels` | False | Value labels: `True`/`"outside"`, `"inside"`, `"center"`. Outside labels widen automatic limits so they fit in the axes; a label too large for its bar goes outside, or is left out on a stacked bar. |
1442
+ | `value_label_format` | 'auto' | Number format of the value labels. |
1069
1443
  | `name` | — | Legend entry; unset: not in the legend. |
1070
1444
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1071
1445
  | `z` | — | Drawing order (higher on top); default: call order. |
1072
1446
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1073
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1447
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1448
+ | `text_color` | inherited ('black') | Text color. |
1074
1449
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1075
1450
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1076
- | `text_color` | inherited ('black') | Text color. |
1077
1451
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1078
1452
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1079
1453
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
@@ -1083,6 +1457,8 @@ pl.Bar(x, height=None, plot=None, **settings)
1083
1457
  | `prefix` | inherited ('') | Text before every number. |
1084
1458
  | `suffix` | inherited ('') | Text after every number. |
1085
1459
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1460
+
1461
+ Groups: `Stroke` (`edge_`), `FillStyle`, `Stroke` (`error_`), `Font`, `NumberFormat`.
1086
1462
  <!-- /settings -->
1087
1463
 
1088
1464
  ### Hist
@@ -1101,7 +1477,7 @@ pl.Hist(values, plot=None, **settings)
1101
1477
  | `weights` | — | A weight per value (per set for several sets). |
1102
1478
  | `stat` | 'count' | `count`, `density` (area 1), `probability`, `percent` or `frequency` (count per unit). |
1103
1479
  | `cumulative` | False | Accumulate the bins. |
1104
- | `kind` | 'bar' | `bar` (adjacent bars), `step` (outline) or `stepfilled`. |
1480
+ | `kind` | 'stepfilled' | `bar` (adjacent bars), `step` (outline) or `stepfilled`. |
1105
1481
  | `bins_scale` | 'axis' | `axis`: bins even on the axis scale (log axes: in log space); `linear`: even in data units. |
1106
1482
  | `orientation` | 'vertical' | `vertical` (bins along x) or `horizontal`. |
1107
1483
  | `stack` | False | Stack the sets (and other stacked histograms with the same bins). |
@@ -1109,19 +1485,20 @@ pl.Hist(values, plot=None, **settings)
1109
1485
  | `color` | — | Fill color, or one per set; default palette colors. |
1110
1486
  | `edge_color` | — | Bar outline color; default none. |
1111
1487
  | `edge_width` | 0.0 | Bar outline width. Length. |
1112
- | `line_color` | — | Step line color; default the fill color. |
1113
- | `line_width` | inherited (1.25) | Step line width. Length. |
1488
+ | `line_color` | — | Step and outline color; default each set's color. |
1489
+ | `line_width` | inherited (0.75) | Step line width. Length. |
1490
+ | `outline` | True | `bar` and `stepfilled` kinds: the outer outline of each set, in `line_color` (dodged bars: each bar's outline). |
1114
1491
  | `alpha` | 'auto' | Opacity; `"auto"`: 0.5 for overlaid sets, else the plot's. |
1115
1492
  | `saturation` | 1.0 | Saturation of the fills. |
1116
- | `labels` | False | Value labels on bars. |
1117
- | `label_format` | 'auto' | Number format of the labels. |
1493
+ | `value_labels` | False | Value labels on bars. |
1494
+ | `value_label_format` | 'auto' | Number format of the value labels. |
1118
1495
  | `name` | — | Legend entry; unset: not in the legend. |
1119
1496
  | `z` | — | Drawing order (higher on top); default: call order. |
1120
1497
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1121
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1498
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1499
+ | `text_color` | inherited ('black') | Text color. |
1122
1500
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1123
1501
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1124
- | `text_color` | inherited ('black') | Text color. |
1125
1502
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1126
1503
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1127
1504
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
@@ -1131,6 +1508,8 @@ pl.Hist(values, plot=None, **settings)
1131
1508
  | `prefix` | inherited ('') | Text before every number. |
1132
1509
  | `suffix` | inherited ('') | Text after every number. |
1133
1510
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1511
+
1512
+ Groups: `Stroke` (`edge_`), `Stroke` (`line_`), `Font`, `NumberFormat`.
1134
1513
  <!-- /settings -->
1135
1514
 
1136
1515
  ### Kde
@@ -1139,7 +1518,7 @@ pl.Hist(values, plot=None, **settings)
1139
1518
  pl.Kde(values, plot=None, **settings)
1140
1519
  ```
1141
1520
 
1142
- A Gaussian kernel density of each set on a common grid of `grid` points, extending `cut` bandwidths past the data (within `clip`). `bandwidth`: `scott` (default), `silverman` (as scipy's `gaussian_kde`) or a number, times `adjust`. On log axes the density is computed in log space, per log unit. `kde.stats`: `grid`, `densities`, `bandwidths`.
1521
+ A Gaussian kernel density of each set on a common grid of `points` points, extending `cut` bandwidths past the data (within `range`). `fill` fills under each curve (`True`: at 0.25, an opacity, or a color). `bandwidth`: `scott` (default), `silverman` (as scipy's `gaussian_kde`) or a number, times `adjust`. On log axes the density is computed in log space, per log unit. `kde.stats`: `grid`, `densities`, `bandwidths`.
1143
1522
 
1144
1523
  <!-- settings:Kde -->
1145
1524
  | Setting | Default | Meaning |
@@ -1147,82 +1526,57 @@ A Gaussian kernel density of each set on a common grid of `grid` points, extendi
1147
1526
  | `bandwidth` | 'scott' | `scott`, `silverman`, or a bandwidth in data units. |
1148
1527
  | `adjust` | 1.0 | Factor applied to the bandwidth. |
1149
1528
  | `cut` | 3.0 | The curve extends this many bandwidths past the data. |
1150
- | `clip` | — | Limits of the curve. |
1151
- | `grid` | 512 | Number of points of the curve. |
1529
+ | `range` | — | Limits of the curve (within the data plus `cut`); default none. |
1530
+ | `points` | 512 | Number of points of the curve. |
1152
1531
  | `cumulative` | False | Plot the cumulative distribution. |
1153
- | `fill` | False | Fill under the curve. |
1532
+ | `fill` | False | Fill under the curve: an opacity of its color, `True` (0.25), a color, or `False` (stacked curves: 0.25). |
1154
1533
  | `weights` | — | A weight per value (per set for several sets). |
1155
1534
  | `orientation` | 'vertical' | `vertical` (values along x) or `horizontal`. |
1156
1535
  | `stack` | False | Stack the sets (seaborn's `multiple="stack"`). |
1157
1536
  | `color` | — | Color, or one per set; default palette colors. |
1158
- | `alpha` | 'auto' | Fill opacity; `"auto"`: 0.25, 1 when stacked. |
1159
- | `line_width` | inherited (1.25) | Line width. Length. |
1537
+ | `line_width` | inherited (0.75) | Line width. Length. |
1160
1538
  | `line_style` | 'solid' | Line style. Length. |
1161
1539
  | `name` | — | Legend entry; unset: not in the legend. |
1540
+ | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1162
1541
  | `z` | — | Drawing order (higher on top); default: call order. |
1163
1542
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1164
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1543
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1544
+ | `text_color` | inherited ('black') | Text color. |
1165
1545
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1166
1546
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1167
- | `text_color` | inherited ('black') | Text color. |
1168
1547
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1169
1548
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1170
1549
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1550
+
1551
+ Groups: `FillStyle`, `Stroke`, `Font`.
1171
1552
  <!-- /settings -->
1172
1553
 
1173
1554
  ### Kde2d
1174
1555
 
1175
1556
  ```python
1176
- p.kde(x, y, levels=10, filled=False, thresh=0.05, **settings) # or pl.Kde(x, y), pl.Kde2d(x, y)
1557
+ p.kde(x, y, levels=10, fill=False, thresh=0.05, **settings) # or pl.Kde(x, y), pl.Kde2d(x, y)
1177
1558
  ```
1178
1559
 
1179
1560
  Density contours of points (seaborn's `kdeplot(x=, y=)`): the 2-D Gaussian density
1180
1561
  (bandwidth as [`Density`](#point-density): scipy's covariance times Scott's factor, or
1181
- Silverman's, a number or a matrix, times `adjust`) on a `gridsize` × `gridsize` grid over
1562
+ Silverman's, a number or a matrix, times `adjust`) on a `points` × `points` grid over
1182
1563
  the data plus `cut` bandwidths, in axis positions (log axes in log space). With a number
1183
1564
  of `levels`, contour k of n encloses an equal share of the mass, from 1 − `thresh` (the
1184
- outermost) up; a list gives density values. Unfilled lines take the series color (the
1185
- next palette color) unless `color_map` is set; `filled=True` colors the bands through
1565
+ outermost) up; a list gives density values. Unfilled lines take the next palette color,
1566
+ or `palette` (one color or colors per level), unless `color_map` is set; `fill=True`
1567
+ colors the bands through
1186
1568
  `color_map`, with the top band up to the maximum. Drawn by the contour code (lines,
1187
1569
  labels, colorbar).
1188
1570
 
1189
1571
  <!-- settings:Kde2d -->
1190
1572
  | Setting | Default | Meaning |
1191
1573
  |---|---|---|
1192
- | `filled` | False | Fill the bands between levels. |
1193
- | `lines` | True | Draw the iso-lines. |
1194
- | `color_map` | inherited ('rainbow_llhh') | Color map of the levels. |
1195
- | `colors` | — | Line color, or one per level, instead of the map. |
1196
- | `line_width` | 'calc(0.6 * var(line_width))' | Line width; default 0.6 × the plot's. Length. |
1197
- | `line_style` | 'solid' | Line style. Length. |
1198
- | `negative_style` | — | Line style of negative levels drawn with a single color (matplotlib: dashed). |
1199
- | `alpha` | 1.0 | Opacity. |
1200
- | `labels` | False | Write the level values on the lines. |
1201
- | `label_format` | 'auto' | Number format of the labels. |
1202
- | `label_font_size` | '0.8em' | Label font size. Length; `%`: of the font size. |
1203
- | `name` | — | Legend entry; unset: not in the legend. |
1204
- | `z` | — | Drawing order (higher on top); default: call order. |
1205
- | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1206
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1207
- | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1208
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1209
- | `text_color` | inherited ('black') | Text color. |
1210
- | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1211
- | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1212
- | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1213
- | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1214
- | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1215
- | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
1216
- | `prefix` | inherited ('') | Text before every number. |
1217
- | `suffix` | inherited ('') | Text after every number. |
1218
- | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1219
1574
  | `levels` | 10 | A number of iso-proportion levels (contour k of n encloses k/n of the mass, above `thresh`), or density values. |
1220
1575
  | `thresh` | 0.05 | Lowest iso-proportion: the outermost contour encloses 1 − `thresh` of the mass. |
1221
1576
  | `bandwidth` | 'scott' | `"scott"`, `"silverman"`, a number or a 2 × 2 matrix, as `Density`. |
1222
1577
  | `adjust` | 1.0 | Factor of the bandwidth. |
1223
1578
  | `cut` | 3.0 | Grid extends this many bandwidths past the data. |
1224
- | `gridsize` | 128 | Grid points per side. |
1225
- | `color` | — | Line color of unfilled contours without a `color_map`; default the next palette color. |
1579
+ | `points` | 128 | Grid points per side. |
1226
1580
  | `colorbar` | False | Attach a colorbar to the plot. |
1227
1581
  <!-- /settings -->
1228
1582
 
@@ -1242,19 +1596,21 @@ A step line through the sorted values of each set: `stat` `proportion`, `count`
1242
1596
  | `complementary` | False | Plot 1 − F (survival). |
1243
1597
  | `orientation` | 'vertical' | `vertical`: values along x; `horizontal`: along y. |
1244
1598
  | `color` | — | Line color, or one per set; default palette colors. |
1245
- | `line_width` | inherited (1.25) | Line width. Length. |
1599
+ | `line_width` | inherited (0.75) | Line width. Length. |
1246
1600
  | `line_style` | 'solid' | Line style. Length. |
1247
1601
  | `name` | — | Legend entry; unset: not in the legend. |
1248
1602
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1249
1603
  | `z` | — | Drawing order (higher on top); default: call order. |
1250
1604
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1251
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1605
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1606
+ | `text_color` | inherited ('black') | Text color. |
1252
1607
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1253
1608
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1254
- | `text_color` | inherited ('black') | Text color. |
1255
1609
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1256
1610
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1257
1611
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1612
+
1613
+ Groups: `Stroke`, `Font`.
1258
1614
  <!-- /settings -->
1259
1615
 
1260
1616
  ### Violin
@@ -1263,39 +1619,46 @@ A step line through the sorted values of each set: `stat` `proportion`, `count`
1263
1619
  pl.Violin(values, positions=None, plot=None, **settings)
1264
1620
  ```
1265
1621
 
1266
- `values` as box plots take them. Each violin is the density of its category, mirrored; `scale` gives equal areas (default), areas proportional to the counts, or equal widths. `inner` draws a thin box with whiskers and a median dot, dashed quartiles, the points, or nothing (`False`). With `split=True`, two violin series share each slot as facing halves.
1622
+ `values` as box plots take them. Each violin is the density of its category, mirrored; `width_scale` gives equal areas (default), areas proportional to the counts, or equal widths. `inner` draws a thin box with whiskers and a median dot, dashed quartiles, the points, or nothing (`False`). With `split=True`, two violin series share each slot as facing halves.
1267
1623
 
1268
1624
  <!-- settings:Violin -->
1269
1625
  | Setting | Default | Meaning |
1270
1626
  |---|---|---|
1271
1627
  | `color` | — | Fill: a color, one per violin (list or dict by category), or numbers per violin mapped through `color_map`; default the next palette color. |
1272
- | `color_map` | inherited ('rainbow_llhh') | How numbers in `color` become colors: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1273
- | `edge_color` | '#333333' | Outline and inner color. |
1628
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1629
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1630
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1631
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1632
+ | `edge_color` | 'series' | Outline and inner color: a color or `"series"` (each violin's own color, at `alpha`). |
1274
1633
  | `edge_width` | 0.75 | Outline width. Length. |
1275
1634
  | `saturation` | 1.0 | Saturation of the fills. |
1276
- | `alpha` | 1.0 | Fill opacity. |
1277
- | `width` | 0.8 | Width of a category's slot. Length; bare numbers: data units. |
1635
+ | `alpha` | 1.0 | Opacity of the violins. |
1636
+ | `fill` | 0.25 | Fill: an opacity of each violin's color, times `alpha` (outlines keep `alpha`); `True` (opaque), a color, or `False`. |
1637
+ | `max_width` | — | Largest width of the series' part of a slot (as `width`); default none. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1638
+ | `width` | '80%' | Violin width: `%` of the slot, a length (bare numbers: px), `d` data units, or a duration on time axes. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1278
1639
  | `bandwidth` | 'scott' | `scott`, `silverman` or a number. |
1279
1640
  | `adjust` | 1.0 | Factor applied to the bandwidth. |
1280
1641
  | `cut` | 2.0 | The density extends this many bandwidths past the data. |
1281
- | `grid` | 512 | Points per violin outline. |
1282
- | `scale` | 'area' | `area`: equal areas; `count`: area proportional to the number of values; `width`: equal widths. |
1642
+ | `points` | 512 | Points per violin outline. |
1643
+ | `width_scale` | 'area' | `area`: equal areas; `count`: area proportional to the number of values; `width`: equal widths. |
1283
1644
  | `inner` | 'box' | Inside each violin: `box` (a thin box, whiskers and a median dot), `quartiles` (dashed lines), `points`, or `False` (nothing). |
1284
1645
  | `split` | False | Two violin series share each slot as facing halves. |
1285
1646
  | `orientation` | 'vertical' | `vertical` (categories on x) or `horizontal`. |
1286
1647
  | `dodge` | True | Violin and box series sharing a category share its slot side by side; `False` overlays them. |
1287
- | `gap` | '10%' | Fraction of each part of a shared slot left empty. Length. |
1648
+ | `gap` | '10%' | Fraction of each part of a shared slot left empty. Length; `%`: of each series' part of a shared slot. |
1288
1649
  | `categories` | — | Category names of a list of arrays. |
1289
1650
  | `name` | — | Legend entry; unset: not in the legend. |
1290
1651
  | `z` | — | Drawing order (higher on top); default: call order. |
1291
1652
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1292
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1653
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1654
+ | `text_color` | inherited ('black') | Text color. |
1293
1655
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1294
1656
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1295
- | `text_color` | inherited ('black') | Text color. |
1296
1657
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1297
1658
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1298
1659
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1660
+
1661
+ Groups: `Stroke` (`edge_`), `FillStyle`, `Font`.
1299
1662
  <!-- /settings -->
1300
1663
 
1301
1664
  ### Strip and swarm
@@ -1311,35 +1674,44 @@ Points of each category's values: `Strip` spreads them by uniform jitter (± `ji
1311
1674
  | Setting | Default | Meaning |
1312
1675
  |---|---|---|
1313
1676
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
1314
- | `size` | 5.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1677
+ | `size` | 4.5 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1315
1678
  | `color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1316
- | `edge_color` | — | Outline: as the fill color. |
1317
- | `edge_width` | 0.5 | Outline width. Length. |
1318
- | `filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1679
+ | `edge_color` | 'auto' | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1680
+ | `edge_width` | 0.75 | Outline width; 0: no outline. Length. |
1681
+ | `fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
1319
1682
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1320
- | `color_map` | inherited ('rainbow_llhh') | How numbers in `color` become colors: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1321
- | `size_map` | — | How numbers in `size` become sizes: a `SizeMap` (alias `smap`); without it, numbers are sizes in px. |
1322
- | `size_legend` | True | With a `size_map`: a size key in the legend (`True`), none (`False`), or the values to show (a list). |
1683
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1684
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1685
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1686
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1687
+ | `size_map` | — | The sizes numbers in `size` are drawn with: a `SizeMap` (alias `smap`); without it (or `size_axis`), numbers are sizes in px. |
1688
+ | `size_limits` | — | Limits of the series' size axis, as an axis' `limits`; unset: `"auto"`. |
1689
+ | `size_scale` | — | Scale of the series' size axis; unset: `linear`. |
1690
+ | `size_axis` | — | A shared `SizeAxis` (`figure.size_axis(…)`) in place of the series' own: it holds the sizes, limits and scale. |
1691
+ | `size_legend` | True | With mapped sizes: a size key in the legend (`True`), none (`False`), or the values to show (a list). |
1323
1692
  | `orientation` | 'vertical' | `vertical` (categories on x) or `horizontal`. |
1324
- | `width` | 0.8 | Width of a category's slot. Length; bare numbers: data units. |
1693
+ | `max_width` | — | Largest width of the series' part of a slot (as `width`); default none. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1694
+ | `width` | '80%' | Width the points spread over: `%` of the slot, a length (bare numbers: px), `d` data units, or a duration on time axes. Length; `%`: of the slot: one category, or the smallest gap between positions; `d`: data units. |
1325
1695
  | `dodge` | True | Point series sharing a category share its slot side by side; `False` overlays them. |
1326
- | `gap` | 0.0 | Fraction of each part of a shared slot left empty. Length. |
1696
+ | `gap` | 0.0 | Fraction of each part of a shared slot left empty. Length; `%`: of each series' part of a shared slot. |
1327
1697
  | `categories` | — | Category names of a list of arrays. |
1328
- | `jitter` | '10%' | Half-width of the jitter (`%` of the slot width). Length. |
1698
+ | `jitter` | '10%' | Half-width of the jitter (`%` of the slot width). Length; `%`: of the slot: one category, or the smallest gap between positions. |
1329
1699
  | `seed` | 0 | Seed of the jitter. |
1330
- | `order` | — | Drawing order: `"density"` (densest drawn last), `"-density"`, or sort keys per point (ascending); default: call order. |
1700
+ | `draw_order` | — | Drawing order: `"density"` (densest drawn last), `"-density"`, or sort keys per point (ascending); default: call order. |
1331
1701
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own; or `"density"` / a `Density`, mapped linearly to `alpha_range`. |
1332
1702
  | `alpha_range` | (0.2, 1.0) | Opacities of the least and most dense points when `alpha` is a density. |
1333
1703
  | `name` | — | Legend entry; unset: not in the legend. |
1334
1704
  | `z` | — | Drawing order (higher on top); default: call order. |
1335
1705
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1336
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1706
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1707
+ | `text_color` | inherited ('black') | Text color. |
1337
1708
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1338
1709
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1339
- | `text_color` | inherited ('black') | Text color. |
1340
1710
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1341
1711
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1342
1712
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1713
+
1714
+ Groups: `Marker`, `Font`.
1343
1715
  <!-- /settings -->
1344
1716
 
1345
1717
  ### Area
@@ -1356,21 +1728,24 @@ Layers (rows of `ys`, or a dict `{name: values}`, one legend entry each) stacked
1356
1728
  | `baseline` | 'zero' | `zero`, `sym` (symmetric around 0), `wiggle` or `weighted_wiggle` (streamgraphs, as matplotlib's stackplot). |
1357
1729
  | `stack` | True | Stack the layers; `False` overlays them from 0. |
1358
1730
  | `color` | — | A color, or one per layer; default palette colors. |
1359
- | `alpha` | 0.85 | Opacity of the fills. |
1360
- | `edge_color` | — | Outline color of each layer's top; default none. |
1731
+ | `alpha` | 0.25 | Opacity of the fills. |
1732
+ | `edge_color` | 'series' | Outline color of each layer's top: a color, `"series"` (each layer's own color) or none. |
1361
1733
  | `edge_width` | 'var(line_width)' | Outline width; default the line width. Length. |
1362
1734
  | `interpolation` | 'linear' | How points are joined: `linear`, `step-pre`, `step-post`, `step-mid`, `monotone` (a curve that never overshoots) or `spline` (centripetal Catmull–Rom). |
1363
1735
  | `missing` | 'break' | Missing values: `break` the line there, or `skip` them and connect their neighbours. |
1736
+ | `orientation` | 'vertical' | `vertical` (layers along x) or `horizontal` (along y). |
1364
1737
  | `name` | — | Legend entry; unset: not in the legend. |
1365
1738
  | `z` | — | Drawing order (higher on top); default: call order. |
1366
1739
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1367
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1740
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1741
+ | `text_color` | inherited ('black') | Text color. |
1368
1742
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1369
1743
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1370
- | `text_color` | inherited ('black') | Text color. |
1371
1744
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1372
1745
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1373
1746
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1747
+
1748
+ Groups: `Stroke` (`edge_`), `Font`.
1374
1749
  <!-- /settings -->
1375
1750
 
1376
1751
  ### Errorbar
@@ -1379,36 +1754,43 @@ Layers (rows of `ys`, or a dict `{name: values}`, one legend entry each) stacked
1379
1754
  pl.Errorbar(x, y, plot=None, **settings)
1380
1755
  ```
1381
1756
 
1382
- Error bars on their own (markers only with `marker=`); `y_error_style="band"` fills the band between the y error ends instead.
1757
+ Error bars on their own (markers only with `marker=`); `y_error_style="band"` fills the band between the y error ends instead. Numbers in `marker_color` map through the series' color axis, as on [Line](#line).
1383
1758
 
1384
1759
  <!-- settings:Errorbar -->
1385
1760
  | Setting | Default | Meaning |
1386
1761
  |---|---|---|
1387
1762
  | `marker` | — | Marker at the points; default none. |
1388
- | `marker_size` | 5.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1763
+ | `marker_size` | 4.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1389
1764
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1390
- | `marker_edge_color` | — | Outline: as the fill color. |
1391
- | `marker_edge_width` | 0.0 | Outline width. Length. |
1392
- | `marker_filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1765
+ | `marker_edge_color` | 'auto' | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1766
+ | `marker_edge_width` | 0.75 | Outline width; 0: no outline. Length. |
1767
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
1393
1768
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1769
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1770
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1771
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1772
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1394
1773
  | `color` | — | Bar color; default: the next palette color. |
1395
- | `line_width` | inherited (1.25) | Bar width. Length. |
1396
- | `cap_length` | 4.0 | Cap width (`data`: in data units across the bar); 0: no caps. Length. |
1774
+ | `line_width` | inherited (0.75) | Bar width. Length. |
1775
+ | `cap_length` | 4.0 | Cap width (`data`: in data units across the bar); 0: no caps. Length; `d`: data units. |
1397
1776
  | `x_error` | — | Horizontal errors. |
1398
1777
  | `y_error` | — | Vertical errors. |
1399
1778
  | `y_error_style` | 'bars' | `bars`, or `band`: a filled band between the y error ends (points sorted by x). |
1400
1779
  | `band_alpha` | 0.25 | Opacity of a band. |
1780
+ | `orientation` | 'vertical' | `vertical` (x along the x axis) or `horizontal` (x along the y axis). |
1401
1781
  | `name` | — | Legend entry; unset: not in the legend. |
1402
1782
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1403
1783
  | `z` | — | Drawing order (higher on top); default: call order. |
1404
1784
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1405
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1785
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1786
+ | `text_color` | inherited ('black') | Text color. |
1406
1787
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1407
1788
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1408
- | `text_color` | inherited ('black') | Text color. |
1409
1789
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1410
1790
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1411
1791
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1792
+
1793
+ Groups: `Marker` (`marker_`), `Font`.
1412
1794
  <!-- /settings -->
1413
1795
 
1414
1796
  ### Stem
@@ -1417,20 +1799,24 @@ Error bars on their own (markers only with `marker=`); `y_error_style="band"` fi
1417
1799
  pl.Stem(x, y=None, plot=None, **settings)
1418
1800
  ```
1419
1801
 
1420
- Stems from `baseline` to each value with a marker (lollipops), and a baseline line.
1802
+ Stems from `baseline` to each value with a marker (lollipops), and a baseline line. Numbers in `marker_color` map through the series' color axis, as on [Line](#line).
1421
1803
 
1422
1804
  <!-- settings:Stem -->
1423
1805
  | Setting | Default | Meaning |
1424
1806
  |---|---|---|
1425
1807
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
1426
- | `marker_size` | 7.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1808
+ | `marker_size` | 5.0 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1427
1809
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1428
- | `marker_edge_color` | — | Outline: as the fill color. |
1429
- | `marker_edge_width` | 0.0 | Outline width. Length. |
1430
- | `marker_filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1810
+ | `marker_edge_color` | — | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1811
+ | `marker_edge_width` | 0.0 | Outline width; 0: no outline. Length. |
1812
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
1431
1813
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1814
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1815
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1816
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1817
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1432
1818
  | `color` | — | Stem and marker color; default: the next palette color. |
1433
- | `line_width` | inherited (1.25) | Stem width. Length. |
1819
+ | `line_width` | inherited (0.75) | Stem width. Length. |
1434
1820
  | `baseline` | 0.0 | Value the stems start from. |
1435
1821
  | `baseline_color` | '#4d4d4d' | Baseline color; `none`: no baseline. |
1436
1822
  | `baseline_width` | 0.75 | Baseline width. Length. |
@@ -1439,13 +1825,15 @@ Stems from `baseline` to each value with a marker (lollipops), and a baseline li
1439
1825
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1440
1826
  | `z` | — | Drawing order (higher on top); default: call order. |
1441
1827
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1442
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1828
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1829
+ | `text_color` | inherited ('black') | Text color. |
1443
1830
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1444
1831
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1445
- | `text_color` | inherited ('black') | Text color. |
1446
1832
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1447
1833
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1448
1834
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1835
+
1836
+ Groups: `Marker` (`marker_`), `Stroke` (`baseline_`), `Font`.
1449
1837
  <!-- /settings -->
1450
1838
 
1451
1839
  ### Regression
@@ -1454,7 +1842,7 @@ Stems from `baseline` to each value with a marker (lollipops), and a baseline li
1454
1842
  pl.Regression(x, y, plot=None, **settings)
1455
1843
  ```
1456
1844
 
1457
- A least-squares polynomial of `order` with the confidence band of the mean (Student's t), or a LOWESS curve (`lowess=True`, no band); `logx` fits against log x. The points are drawn too unless `scatter=False` (marker settings with the `marker_` prefix). `regression.stats`: `coefficients` (lowest power first), `r2`, `se`, and the curve.
1845
+ A least-squares polynomial of `order` with the confidence band of the mean (Student's t), or a LOWESS curve (`lowess=True`, no band); `logx` fits against log x; `range` sets the x range of the polynomial curve (default the data's), drawn in `points` points. The points are drawn too unless `scatter=False` (marker settings with the `marker_` prefix; numbers in `marker_color` map through the series' color axis, as on [Line](#line)). `regression.stats`: `coefficients` (lowest power first), `r2`, `se`, and the curve.
1458
1846
 
1459
1847
  <!-- settings:Regression -->
1460
1848
  | Setting | Default | Meaning |
@@ -1465,30 +1853,37 @@ A least-squares polynomial of `order` with the confidence band of the mean (Stud
1465
1853
  | `ci` | 95.0 | Confidence level of the band (%); `None`: no band. |
1466
1854
  | `logx` | False | Fit y against log(x) (x > 0). |
1467
1855
  | `scatter` | True | Draw the points too. |
1468
- | `truncate` | True | Draw the fit over the data range only (`False`: over the axis range). |
1856
+ | `range` | — | x range of the fitted polynomial (and band); default the data range. |
1469
1857
  | `points` | 100 | Points of the fitted curve. |
1470
1858
  | `color` | — | Line, band and point color; default the next palette color. |
1471
- | `line_width` | 'calc(1.4 * var(line_width))' | Line width; default 1.4 × the plot's. Length. |
1859
+ | `line_width` | 'calc(1.4 * inherit)' | Line width; default 1.4 × the plot's. Length. |
1472
1860
  | `line_style` | 'solid' | Line style or dash list. Length. |
1473
1861
  | `band_alpha` | 0.2 | Opacity of the band. |
1474
1862
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
1475
- | `marker_size` | 5.0 | Marker size: the diameter of the circle of equal area; one value or one per point; numbers per point are values to map when `size_map` is set; or `"density"`. Length. |
1863
+ | `marker_size` | 4.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1476
1864
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1477
- | `marker_edge_color` | — | Outline: as the fill color. |
1478
- | `marker_edge_width` | 0.0 | Outline width. Length. |
1479
- | `marker_filled` | True | `True`: filled with the color; `False`: hollow, outlined in the color; a number: filled at that opacity and outlined in the color. |
1865
+ | `marker_edge_color` | 'auto' | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1866
+ | `marker_edge_width` | 0.75 | Outline width; 0: no outline. Length. |
1867
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color; an opacity (0–1): filled at that opacity and outlined in the color. |
1480
1868
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1869
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1870
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1871
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1872
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1873
+ | `orientation` | 'vertical' | `vertical` (y on x) or `horizontal` (the fit drawn with x along the y axis). |
1481
1874
  | `name` | — | Legend entry; unset: not in the legend. |
1482
1875
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1483
1876
  | `z` | — | Drawing order (higher on top); default: call order. |
1484
1877
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1485
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1878
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1879
+ | `text_color` | inherited ('black') | Text color. |
1486
1880
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1487
1881
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1488
- | `text_color` | inherited ('black') | Text color. |
1489
1882
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1490
1883
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1491
1884
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1885
+
1886
+ Groups: `Stroke`, `Marker` (`marker_`), `Font`.
1492
1887
  <!-- /settings -->
1493
1888
 
1494
1889
  ### Hist2d
@@ -1502,32 +1897,6 @@ Counts in rectangular bins (even on the axis scales), drawn as a heatmap with th
1502
1897
  <!-- settings:Hist2d -->
1503
1898
  | Setting | Default | Meaning |
1504
1899
  |---|---|---|
1505
- | `color_map` | inherited ('rainbow_llhh') | A `ColorMap`, a map name or a list of colors. |
1506
- | `color_limits` | — | Override of the map's limits for this series. |
1507
- | `color_scale` | — | Override of the map's scale. |
1508
- | `mode` | 'image' | `image` (one image pixel per cell), `cells` (rectangles) or `smooth` (interpolated). |
1509
- | `nan_color` | — | Color of missing cells; default: the map's `bad` (transparent). |
1510
- | `labels` | False | Write each cell's value (`"all"` above 2,500 cells). |
1511
- | `label_format` | 'auto' | Number format of cell labels (`auto`: 3 significant digits, the same decimals for all cells). |
1512
- | `label_font_size` | '0.9em' | Font size of cell labels. Length; `%`: of the font size. |
1513
- | `colorbar` | False | Attach a colorbar to the plot. |
1514
- | `name` | — | Legend entry; unset: not in the legend. |
1515
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1516
- | `z` | — | Drawing order (higher on top); default: call order. |
1517
- | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1518
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1519
- | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1520
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1521
- | `text_color` | inherited ('black') | Text color. |
1522
- | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1523
- | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1524
- | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1525
- | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1526
- | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1527
- | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
1528
- | `prefix` | inherited ('') | Text before every number. |
1529
- | `suffix` | inherited ('') | Text after every number. |
1530
- | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1531
1900
  | `bins` | ('auto', 'auto') | Bins of both axes, or `(x bins, y bins)`: counts, edges or rules (as `Hist`). |
1532
1901
  | `range` | — | `((x0, x1), (y0, y1))`; default the data range. |
1533
1902
  | `weights` | — | A weight per point. |
@@ -1542,21 +1911,23 @@ Counts in rectangular bins (even on the axis scales), drawn as a heatmap with th
1542
1911
  pl.Hexbin(x, y, plot=None, **settings)
1543
1912
  ```
1544
1913
 
1545
- Counts in regular hexagons: `gridsize` hexagons across the axes width, on a lattice laid out
1546
- in page units once the axes are placed, so the hexagons tile exactly whatever the axes'
1547
- aspect (and the counts depend on it). Points outside the axes are not counted. Colored by
1548
- `cmap`; a colorbar source.
1914
+ Counts in regular hexagons: `bins` hexagons across the axes width, on a lattice laid out
1915
+ in page units for the axes the layout places, so the hexagons tile exactly whatever the
1916
+ axes' aspect. The counts depend on the axes, and the color axis on the counts: the layout
1917
+ counts again when a round places the axes differently ([layout](#layout)). Points outside
1918
+ the axes are not counted. Colored by `cmap`; a colorbar source.
1549
1919
 
1550
1920
  <!-- settings:Hexbin -->
1551
1921
  | Setting | Default | Meaning |
1552
1922
  |---|---|---|
1553
- | `gridsize` | 30 | Hexagons across the axes width. |
1923
+ | `bins` | 30 | Hexagons across the axes width. |
1554
1924
  | `weights` | — | A weight per point (sums). |
1555
1925
  | `stat` | 'count' | `count`, `probability` or `percent`. |
1556
1926
  | `min_count` | 1.0 | Hexagons below this count are not drawn. |
1557
- | `color_map` | inherited ('rainbow_llhh') | A `ColorMap`, a map name or colors. |
1558
- | `color_limits` | — | Override of the map's limits. |
1559
- | `color_scale` | — | Override of the map's scale. |
1927
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1928
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1929
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1930
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1560
1931
  | `edge_color` | — | Hexagon outline color; default none. |
1561
1932
  | `edge_width` | 0.0 | Outline width. Length. |
1562
1933
  | `colorbar` | False | Attach a colorbar to the plot. |
@@ -1564,13 +1935,15 @@ aspect (and the counts depend on it). Points outside the axes are not counted. C
1564
1935
  | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1565
1936
  | `z` | — | Drawing order (higher on top); default: call order. |
1566
1937
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1567
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1938
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1939
+ | `text_color` | inherited ('black') | Text color. |
1568
1940
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1569
1941
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1570
- | `text_color` | inherited ('black') | Text color. |
1571
1942
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1572
1943
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1573
1944
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1945
+
1946
+ Groups: `Stroke` (`edge_`), `Font`.
1574
1947
  <!-- /settings -->
1575
1948
 
1576
1949
  ### Contour
@@ -1579,31 +1952,34 @@ aspect (and the counts depend on it). Points outside the axes are not counted. C
1579
1952
  pl.Contour(values, x=None, y=None, plot=None, **settings)
1580
1953
  ```
1581
1954
 
1582
- Iso-lines (`lines`) and filled bands (`filled`) of a grid at nodes `x`/`y`. `levels`: a number of nice values over the data, or the values. Lines take the map's colors, or `colors`; `negative_style` dashes negative levels drawn in one color; `labels` writes the levels on the lines. Bands are colored by their middle value.
1955
+ Iso-lines (`lines`) and filled bands (`fill`) of a grid at nodes `x`/`y`. `levels`: a number of nice values over the data, or the values. Lines take the map's colors, or `palette` (one color, or colors per level in turn: a list or a palette name); `negative_style` dashes negative levels drawn in one color; `value_labels` writes the levels on the lines. Bands are colored by their middle value.
1583
1956
 
1584
1957
  <!-- settings:Contour -->
1585
1958
  | Setting | Default | Meaning |
1586
1959
  |---|---|---|
1587
1960
  | `levels` | 10 | A number of levels (nice values over the data) or the level values. |
1588
- | `filled` | False | Fill the bands between levels. |
1961
+ | `fill` | False | Fill the bands between levels: `True`, an opacity (0–1, times `alpha`), or `False`. |
1589
1962
  | `lines` | True | Draw the iso-lines. |
1590
- | `color_map` | inherited ('rainbow_llhh') | Color map of the levels. |
1591
- | `colors` | — | Line color, or one per level, instead of the map. |
1592
- | `line_width` | 'calc(0.6 * var(line_width))' | Line width; default 0.6 × the plot's. Length. |
1963
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
1964
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
1965
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1966
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1967
+ | `palette` | — | Line color, or colors taken per level in turn (a list or a palette name), instead of the map. |
1968
+ | `line_width` | 'calc(0.6 * inherit)' | Line width; default 0.6 × the plot's. Length. |
1593
1969
  | `line_style` | 'solid' | Line style. Length. |
1594
1970
  | `negative_style` | — | Line style of negative levels drawn with a single color (matplotlib: dashed). |
1595
1971
  | `alpha` | 1.0 | Opacity. |
1596
- | `labels` | False | Write the level values on the lines. |
1597
- | `label_format` | 'auto' | Number format of the labels. |
1598
- | `label_font_size` | '0.8em' | Label font size. Length; `%`: of the font size. |
1972
+ | `value_labels` | False | Write the level values on the lines. |
1973
+ | `value_label_format` | 'auto' | Number format of the value labels. |
1974
+ | `value_label_font_size` | '0.8em' | Label font size. Length; `%`: of the font size. |
1599
1975
  | `colorbar` | False | Attach a colorbar to the plot. |
1600
1976
  | `name` | — | Legend entry; unset: not in the legend. |
1601
1977
  | `z` | — | Drawing order (higher on top); default: call order. |
1602
1978
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1603
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
1979
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1980
+ | `text_color` | inherited ('black') | Text color. |
1604
1981
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1605
1982
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1606
- | `text_color` | inherited ('black') | Text color. |
1607
1983
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1608
1984
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1609
1985
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
@@ -1613,6 +1989,8 @@ Iso-lines (`lines`) and filled bands (`filled`) of a grid at nodes `x`/`y`. `lev
1613
1989
  | `prefix` | inherited ('') | Text before every number. |
1614
1990
  | `suffix` | inherited ('') | Text after every number. |
1615
1991
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
1992
+
1993
+ Groups: `FillStyle`, `Stroke`, `TextStyle` (`value_label_`), `Font`, `NumberFormat`.
1616
1994
  <!-- /settings -->
1617
1995
 
1618
1996
  ### Pie
@@ -1621,32 +1999,34 @@ Iso-lines (`lines`) and filled bands (`filled`) of a grid at nodes `x`/`y`. `lev
1621
1999
  pl.Pie(values, plot=None, **settings)
1622
2000
  ```
1623
2001
 
1624
- Wedges of `values` (a sequence or a dict `{label: value}`) from `start`, on a plot drawn without axes (`Plot.axes=False`, aspect 1). `hole` makes a donut (`"40%"` of the radius), `explode` moves wedges out (`%` of the radius, one value or one per wedge). Names go outside (pushed apart so that they do not overlap), inside, or into the legend (`label_position="none"`, the legend then outside right); `value_labels` writes percents or values inside, or outside with a leader line when a wedge is too thin.
2002
+ Wedges of `values` (a sequence or a dict `{label: value}`) from `start`, on a plot drawn without axes (`Plot.axes=False`, aspect 1). `hole` makes a donut (`"40%"` of the radius), `explode` moves wedges out (`%` of the radius, one value or one per wedge). Names go outside (pushed apart so that they do not overlap), inside, or into the legend (`name_position="none"`, the legend then outside right); `palette` colors them in turn; `value_labels` writes percents or values inside, or outside with a leader line when a wedge is too thin.
1625
2003
 
1626
2004
  <!-- settings:Pie -->
1627
2005
  | Setting | Default | Meaning |
1628
2006
  |---|---|---|
1629
- | `labels` | — | Wedge names (default: the dict's keys). |
1630
- | `colors` | — | One color per wedge; default palette colors. |
2007
+ | `names` | — | Wedge names (default: the dict's keys). |
2008
+ | `palette` | — | Wedge colors, taken in turn: a list of colors or a palette name; default the plot's palette. |
1631
2009
  | `start` | 90.0 | Angle where the first wedge starts (degrees, 0: 3 o'clock, 90: 12 o'clock). Angle (bare: degrees). |
1632
2010
  | `counterclockwise` | True | Direction of the wedges. |
1633
- | `hole` | 0.0 | Radius of the hole (`%` of the radius): a donut. Length. |
1634
- | `explode` | — | Offset of the wedges from the centre (`%` of the radius): one value or one per wedge. Length. |
2011
+ | `hole` | 0.0 | Radius of the hole (`%` of the radius): a donut. Length; `%`: of the radius. |
2012
+ | `explode` | — | Offset of the wedges from the centre (`%` of the radius): one value or one per wedge. Length; `%`: of the radius. |
1635
2013
  | `sort` | False | Sort the wedges by decreasing value. |
1636
- | `label_position` | 'outside' | Where the names go: `outside`, `inside` or `none` (in the legend instead). |
2014
+ | `name_position` | 'outside' | Where the names go: `outside`, `inside` or `none` (in the legend instead). |
1637
2015
  | `value_labels` | False | Write each wedge's `percent` or `value` inside it (outside, with a leader line, when it does not fit). |
1638
2016
  | `label_spacing` | '1.25em' | Smallest distance between outside labels on a side. Length; `%`: of the font size. |
1639
- | `label_format` | 'auto' | Number format of the value labels (percentages: of 100). |
1640
- | `edge_color` | 'white' | Wedge outline color; `none`: no outline. |
2017
+ | `value_label_format` | 'auto' | Number format of the value labels (percentages: of 100). |
2018
+ | `edge_color` | 'series' | Wedge outline color: a color, `"series"` (each wedge's own color) or `none`. |
1641
2019
  | `edge_width` | 1.25 | Wedge outline width. Length. |
1642
2020
  | `alpha` | 1.0 | Opacity. |
2021
+ | `fill` | 0.25 | Wedge fill: an opacity of each wedge's color, times `alpha` (outlines keep `alpha`); `True` (opaque), a color, or `False`. |
2022
+ | `seam_color` | 'white' | The edges neighbouring wedges share, in this color; `none`: both outlines as drawn. |
1643
2023
  | `name` | — | Legend entry; unset: not in the legend. |
1644
2024
  | `z` | — | Drawing order (higher on top); default: call order. |
1645
2025
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1646
- | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: pdf_io's `simplify`. |
2026
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
2027
+ | `text_color` | inherited ('black') | Text color. |
1647
2028
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1648
2029
  | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1649
- | `text_color` | inherited ('black') | Text color. |
1650
2030
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1651
2031
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1652
2032
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
@@ -1656,65 +2036,122 @@ Wedges of `values` (a sequence or a dict `{label: value}`) from `start`, on a pl
1656
2036
  | `prefix` | inherited ('') | Text before every number. |
1657
2037
  | `suffix` | inherited ('') | Text after every number. |
1658
2038
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
2039
+
2040
+ Groups: `Stroke` (`edge_`), `FillStyle`, `Font`, `NumberFormat`.
2041
+ <!-- /settings -->
2042
+
2043
+ ## 6. Color and size axes
2044
+
2045
+ Numbers given as colors (per point, per cell, per category, or a density) go through a
2046
+ **color axis** before they become colors, as positions go through an x axis: its scale
2047
+ and limits take each value to [0, 1], and its gradient (a `ColorMap`) gives the color.
2048
+ Sizes go through a **size axis** the same way, with a `SizeMap` (diameters) in place of
2049
+ the gradient. A colorbar is the guide of a color axis, a size key that of a size axis.
2050
+
2051
+ ```python
2052
+ h = p.heatmap(v, cmap="magma", color_limits="q:0.01/q:0.99", color_scale="log")
2053
+ h.color_axis # the series' own color axis
2054
+ ca = fig.color_axis(color_map="magma", limits="0/max") # a shared one
2055
+ p.heatmap(v, color_axis=ca)
2056
+ q.scatter(x, y, c=z, color_axis=ca)
2057
+ fig.colorbar(ca, id=5, label="energy")
2058
+ fig = pl.Figure(cols=3, share_color="row") # each row's plots: one color axis
2059
+ fig = pl.Figure(cols=3, share_size="all") # one size axis, one size key
2060
+ ```
2061
+
2062
+ * **Own axes.** A series that maps values has its own color axis, `series.color_axis`
2063
+ (and size axis, `series.size_axis`). Its `scale` is the series' `color_scale`, its
2064
+ `limits` the series' `color_limits` (axis syntax: `"auto"`, the values' range;
2065
+ `"0/max"`, `"q:0.01/q:0.99"`, `[lo, hi]`), its gradient the series' `color_map`
2066
+ (inherited: the plot's, the figure's, the style's). Its other settings (ticks,
2067
+ `tick_format`, `label`, fonts) are drawn by its colorbar. A `scale` or `limits` set on
2068
+ the axis itself wins over the series' settings.
2069
+ * **Shared axes.** `fig.color_axis(**settings)` (`fig.size_axis(**settings)`) makes an
2070
+ axis that series take as `color_axis=` (`size_axis=`). It holds the gradient
2071
+ (`color_map`; sizes: `size_map`), the scale and the limits; its automatic limits cover
2072
+ every series using it, and those series take no `color_map`, `color_limits` or
2073
+ `color_scale` of their own (an error). A `pl.ColorAxis(**settings)` made alone joins
2074
+ the figure of the first series given it. The members of a `group=` call share one axis
2075
+ of each kind.
2076
+ * **`share_color`.** The figure's `share_color` (`False`, `True`/`"all"`, `"col"` or
2077
+ `"row"`, as `share_x`) makes the own color axes of each group's plots one axis: limits
2078
+ over all their values; one `color_limits` (or scale) applies to the group, two
2079
+ different ones are an error. Each series keeps its gradient. Facet figures share
2080
+ color this way (`"all"` by default).
2081
+ * **`share_size`** does the same for the own size axes: limits over all the group's
2082
+ values, one `size_limits` (or `size_scale`) for the group, and one size key for the
2083
+ group ([legend](#legend)). Each series keeps its `size_map`. Facet figures share size
2084
+ too (`"all"`).
2085
+ * **Training.** Before the layout, each axis is resolved from the values it maps, by the
2086
+ code of x and y axes: the scale's domain, `limits` and quantiles, `include_zero`, no
2087
+ padding (unless `padding` is set). Values past the limits take the gradient's
2088
+ `under`/`over` colors and missing values its `bad` color (sizes: the `SizeMap`'s).
2089
+
2090
+ Color and size axes have the settings of [axes](#4-axes); these differ:
2091
+
2092
+ <!-- settings:ColorAxis -->
2093
+ | Setting | Default | Meaning |
2094
+ |---|---|---|
2095
+ | `scale` | — | Scale of the mapped values: `linear`, `log`, `log2`, `log10`, `sqrt`, `exp`, `symlog` or `logit`; default `linear`. |
2096
+ | `color_map` | inherited ('rainbow_llhh') | The gradient: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
2097
+ <!-- /settings -->
2098
+
2099
+ <!-- settings:SizeAxis -->
2100
+ | Setting | Default | Meaning |
2101
+ |---|---|---|
2102
+ | `scale` | — | Scale of the mapped values: `linear`, `log`, `log2`, `log10`, `sqrt`, `exp`, `symlog` or `logit`; default `linear`. |
2103
+ | `size_map` | — | The sizes: a `SizeMap` or a pair of diameters; default `SizeMap()`. |
1659
2104
  <!-- /settings -->
1660
2105
 
1661
- ## 6. Colorbars
2106
+ ### Colorbars
1662
2107
 
1663
2108
  ```python
1664
2109
  p.colorbar(source=None, **settings) # attached to a side of the plot
1665
2110
  fig.colorbar(source, id=None, **settings) # in its own grid area
1666
- cb.axis # an Axis: ticks, labels, format
2111
+ cb.axis # the color axis shown
1667
2112
  ```
1668
2113
 
1669
- `source` is a heatmap, a series with a `ColorMap`, or a `ColorMap` (shared by several
1670
- series, whose `"auto"` limits then cover all of them). Attached bars take margin on their
1671
- side, so axes stay aligned. A bar in its own area runs along the neighbouring axes
1672
- (`align="axes"`) or boxes (`"borders"`). Axis settings can be given directly:
1673
- `p.colorbar(h, label="z", tick_format="{:.0%}")`.
2114
+ `source` is a mapped series (its color axis; default: the plot's last mapped series) or
2115
+ a color axis. The bar draws the axis' gradient between its trained limits, with the
2116
+ axis' ticks, number format and fonts, and a label: `label`, else the axis' `label`, else
2117
+ the name of the color column or density. Attached bars take margin on their side, so axes
2118
+ stay aligned. A bar in its own area runs along the neighbouring axes (`align="axes"`) or
2119
+ boxes (`"borders"`). Axis settings given to a bar go to its axis:
2120
+ `p.colorbar(h, label="z", tick_format="{:.0%}")` sets `h.color_axis`'s tick format.
1674
2121
 
1675
2122
  <!-- settings:Colorbar -->
1676
2123
  | Setting | Default | Meaning |
1677
2124
  |---|---|---|
1678
2125
  | `position` | 'right' | Side of the plot an attached bar takes. |
1679
- | `orientation` | 'auto' | Bar direction; default: vertical, or horizontal for bars attached at the top or bottom. |
1680
- | `thickness` | 13.0 | Bar thickness (`%` of the attached axes side across it). Length. |
1681
- | `length` | '100%' | Bar length as a fraction of the axes side (attached bars). Length. |
1682
- | `pad` | 11.0 | Gap between the axes and an attached bar. Length. |
1683
- | `label` | — | Bar label: a string or rich content. |
1684
- | `extend` | 'auto' | Triangular ends in the under/over colors: `auto` shows them when the limits clip the data. |
2126
+ | `orientation` | 'auto' | Bar direction; `"auto"`: vertical, or horizontal for bars attached at the top or bottom. |
2127
+ | `thickness` | 13.0 | Bar thickness (`%` of the attached axes side across it). Length; `%`: of the axes side across the colorbar. |
2128
+ | `length` | '100%' | Bar length as a fraction of the axes side (attached bars). Length; `%`: of the axes side along the colorbar. |
2129
+ | `pad` | 11.0 | Gap between the axes and an attached bar. Length; `%`: of the axes side across the colorbar. |
2130
+ | `label` | — | Bar label: a string or rich content; default: the axis' `label`, else the name of the color column or density. |
2131
+ | `extend` | 'auto' | Ends in the under/over colors: `auto` shows them when the limits clip the data. |
2132
+ | `extend_shape` | 'block' | `block`: a separate block at the end of the bar, within its length; `triangle`: a triangle past the bar's end. |
1685
2133
  | `frame` | False | Outline the bar. |
1686
2134
  | `frame_color` | '#666666' | Outline color. |
1687
2135
  | `frame_width` | 0.5 | Outline width. Length. |
1688
- | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1689
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1690
- | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1691
- | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1692
- | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1693
- | `text_color` | inherited ('black') | Text color. |
1694
- | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1695
- | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1696
- | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
1697
- | `prefix` | inherited ('') | Text before every number. |
1698
- | `suffix` | inherited ('') | Text after every number. |
1699
- | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
2136
+
2137
+ Groups: `Stroke` (`frame_`).
1700
2138
  <!-- /settings -->
1701
2139
 
1702
2140
  ## 7. Colors, maps and markers
1703
2141
 
1704
2142
  ### Colors and palette
1705
2143
 
1706
- Colors are anything pdf_io accepts (CSS names, `#hex`, `(r, g, b[, a])` floats,
2144
+ Colors are anything vec_io accepts (CSS names, `#hex`, `(r, g, b[, a])` floats,
1707
2145
  `CMYK`, `Spot`) or `"C0"`, `"C1"`, … for palette entries; `"none"` paints nothing. The
1708
- default palette `pl.PALETTE` (`"okabe_ito"`) is Okabe–Ito's eight colorblind-safe colors
1709
- plus indigo and dark brown, chosen as the pair farthest from every other color (in Oklab)
1710
- under normal and simulated protan, deutan and tritan vision.
2146
+ default palette (`"tab10_custom"`, `plot_io.color.palettes.PALETTE`) is tab10's ten hues as named colors: sky,
2147
+ amber, emerald, rose, purple 0.4, yellow 0.7, pink 0.4, gray, lime, cyan.
1711
2148
 
1712
2149
  `palette` takes a `pl.Palette`, a registered name (`"tab10"`; `"tab10_r"` reversed), a
1713
2150
  list of colors (or one comma-separated string: `"red, teal 0.7"`), or a function `n -> colors`, called with the number of series of the plot
1714
2151
  that take a palette color.
1715
2152
 
1716
2153
  ```python
1717
- pl.Palette(colors="okabe_ito", name=None) # a name, colors, a Palette or n -> colors
2154
+ pl.Palette(colors="tab10_custom", name=None) # a name, colors, a Palette or n -> colors
1718
2155
  pl.register_palette(name, palette) # a Palette, colors or a function
1719
2156
  pl.palette_names()
1720
2157
  ```
@@ -1730,7 +2167,8 @@ parts: `palette=pl.ColorMap("viridis").to_palette(5)` for ordered categories.
1730
2167
 
1731
2168
  | Palette | Colors |
1732
2169
  |---|---|
1733
- | `okabe_ito` | plot_io's default (10) |
2170
+ | `tab10_custom` | plot_io's default: tab10's hues as named colors (10) |
2171
+ | `okabe_ito` | Okabe–Ito's eight colorblind-safe colors plus indigo and dark brown, chosen as the pair farthest from every other color (in Oklab) under normal and simulated protan, deutan and tritan vision (10) |
1734
2172
  | `tab10` | matplotlib ≥ 2.0, d3's category10 (10) |
1735
2173
  | `matplotlib_classic` | matplotlib 1.x: b, g, r, c, m, y, k (7) |
1736
2174
  | `tableau10` | Vega-Lite's default (10) |
@@ -1750,9 +2188,8 @@ parts: `palette=pl.ColorMap("viridis").to_palette(5)` for ordered categories.
1750
2188
  ### Color maps
1751
2189
 
1752
2190
  ```python
1753
- pl.ColorMap(colors="rainbow_llhh", positions=None, limits="auto", scale="linear",
1754
- under=None, over=None, bad=None, space=None, name=None, interpolation=None,
1755
- widen_colors=1, widen_sides=1.0)
2191
+ pl.ColorMap(colors="rainbow_llhh", positions=None, under=None, over=None, bad=None,
2192
+ space=None, name=None, interpolation=None, widen_colors=1, widen_sides=1.0)
1756
2193
  pl.register_color_map(name, color_map)
1757
2194
  pl.color_map_names()
1758
2195
  ```
@@ -1760,15 +2197,14 @@ pl.color_map_names()
1760
2197
  | Member | |
1761
2198
  |---|---|
1762
2199
  | `colors` | a name (`viridis`, `magma`, `inferno`, `plasma`, `cividis`, `coolwarm`, `grey`, `rocket`, `mako`, `flare`, `crest`, `vlag`, `icefire`, `jet`, `parula`, `turbo`, `ggplot2`, the rainbows, ColorBrewer's and Crameri's maps below, in any case (`"RdBu"`, `"batlowK"`); `_r` reverses), a list of colors (evenly spaced or at `positions`; or one string, comma-separated: `"violet 0.4, sky 0.4, green 0.4"`), a `ColorMap` (copied) or a function `t -> color` |
1763
- | `limits`, `scale` | axis syntax, applied to the mapped values; `"auto"` covers every series using the map |
1764
- | `under`, `over`, `bad` | colors below/above the limits (default: the end colors) and of missing values (default: transparent) |
2200
+ | `under`, `over`, `bad` | colors below 0 and above 1, past the color axis' limits (default: the end colors), and of missing values (default: transparent) |
1765
2201
  | `space` | interpolation between the colors: `"oklab"` (default, for every map: perceptually even) or `"srgb"` |
1766
- | `interpolation` | `"linear"` (default): between neighboring colors; `"nearest"`: equal steps, one per color (`n` colors, `n` bins; with `positions`, each step starts at its position); `"smooth"`: a Bézier curve with the colors as control points, through the first and last only (no `positions`); `"spline"`: a monotone cubic curve through every color (PCHIP in Oklab: no overshoot between colors) |
2202
+ | `interpolation` | `"linear"` (default): between neighboring colors; `"nearest"`: equal steps, one per color (`n` colors, `n` bins; with `positions`, each step starts at its position; a value on an edge takes the upper step); `"smooth"`: a Bézier curve with the colors as control points, through the first and last only (no `positions`); `"spline"`: a monotone cubic curve through every color (PCHIP in Oklab: no overshoot between colors) |
1767
2203
  | `widen_colors`, `widen_sides` | each inner color of a list repeated `widen_colors` times, each end color `round(widen_sides × widen_colors)` times: wider bands around the colors |
1768
- | `cm(t)`, `colors_at(ts)` | color at t ∈ [0, 1]; bulk colors (C) |
2204
+ | `cm(t)`, `colors_at(ts)` | color at t ∈ [0, 1]; bulk colors (C: continuous maps through a table of 4,096 colors, steps exactly) |
2205
+ | `table(n)`, `cells(values, lo, hi, mode)` | n colors sampled evenly; what heatmap cells hand vec_io's `draw_cells` (C): palette indices into `table(255)` (`table(253)` plus the under and over colors), or for `smooth` positions along `table(256)` (steps: the step colors and their bounds) |
1769
2206
  | `reversed()`, `resampled(n)`, `truncated(lo, hi)`, `with_extremes(…)` | copies: reversed; n flat steps; a part stretched to [0, 1]; new extremes |
1770
2207
  | `to_palette(n)` | a `Palette` of `n` colors sampled at the centers of `n` equal parts |
1771
- | `to_pdf_io()` | the equivalent pdf_io color map (maps with fewer than 256 colors as 256 sRGB stops) |
1772
2208
 
1773
2209
  Bundled data: viridis, magma, inferno and plasma by van der Walt and Smith (CC0); cividis
1774
2210
  by Nuñez, Anderton and Renslow; coolwarm by Moreland; rocket, mako, flare, crest, vlag and
@@ -1792,40 +2228,51 @@ ColorBrewer's schemes by Brewer (Apache-2.0): sequential `blues`, `bugn`, `bupu`
1792
2228
  multi-sequential `oleron`, `bukavu`, `fes` and cyclic `romao`, `bamo`, `broco`, `corko`,
1793
2229
  `viko` (256 colors each);
1794
2230
  `ggplot2` is ggplot2's continuous default (`#132B43` → `#56B1F7`). The
1795
- `color_map` setting (alias `cmap`; inherited, default `"rainbow_llhh"`) is the map of heatmaps,
1796
- contours and numbers given as colors. One `ColorMap` object given to several series
1797
- shares its `"auto"` limits.
2231
+ `color_map` setting (alias `cmap`; inherited, default `"rainbow_llhh"`) is the gradient of
2232
+ heatmaps, contours and numbers given as colors. A `ColorMap` is a gradient over [0, 1]
2233
+ only: the values' limits and scale are their [color axis](#6-color-and-size-axes)'s, so
2234
+ series given one `ColorMap` object keep limits of their own; a shared color axis shares
2235
+ limits.
1798
2236
 
1799
2237
  ### Size maps
1800
2238
 
1801
2239
  ```python
1802
- pl.SizeMap(sizes=(2, 10), limits="auto", scale="linear", by="area",
1803
- under=None, over=None, bad=None)
2240
+ pl.SizeMap(sizes=(3, 13), by="area", under=None, over=None, bad=None)
1804
2241
  ```
1805
2242
 
1806
- `sizes` are the diameters at the limits. `by="area"` moves the area linearly between
1807
- the end areas (with `sizes=(0, d)` and `limits="0/max"`, area is proportional to the
1808
- value); `by="diameter"` moves the diameter. `under`/`over` default to the end sizes;
1809
- `"none"` leaves those points out. `bad` (missing values) leaves them out by default.
2243
+ `sizes` are the diameters at the limits of the [size axis](#6-color-and-size-axes).
2244
+ `by="area"` moves the area linearly between the end areas (with `sizes=(0, d)` and
2245
+ `size_limits="0/max"`, area is proportional to the value); `by="diameter"` moves the
2246
+ diameter. `under`/`over` default to the end sizes; `"none"` leaves those points out.
2247
+ `bad` (missing values) leaves them out by default. `size_map` also takes a pair of
2248
+ diameters.
1810
2249
 
1811
2250
  ### Values in color and size
1812
2251
 
1813
- | Given to `color` (also `edge_color`, `marker_color`) | Meaning |
2252
+ | Given to `color` (also `edge_color`, `marker_color`, `marker_edge_color`) | Meaning |
1814
2253
  |---|---|
1815
2254
  | a color string, `CMYK`, `Spot`, or a **tuple** of 3 or 4 numbers | one color |
1816
2255
  | a list of colors | one color per point |
1817
- | a **list, array or other buffer of numbers** | one value per point, mapped through `color_map` |
2256
+ | a **list, array or other buffer of numbers** | one value per point, mapped through the color axis |
1818
2257
  | an `(n, 3)` or `(n, 4)` buffer | one color per point |
1819
- | `"density"` or `pl.Density(…)` | the points' density, mapped through `color_map` |
2258
+ | `"density"` or `pl.Density(…)` | the points' density, mapped through the color axis |
1820
2259
  | a dict `{category: number}` or `{category: color}` (box, bar, violin) | per category |
1821
2260
 
1822
2261
  A tuple of numbers is always one color and a list of numbers is always values, so
1823
2262
  `color=[0.2, 0.4, 0.6]` with a point count other than 3 is an error (use a tuple for one
1824
- RGB color). A `ColorMap` goes in `color_map`, not `color`.
1825
-
1826
- `size` takes a diameter (a length), diameters per point (px), or values per point mapped through
1827
- `size_map` when it is set; `"density"` uses `size_map` or `SizeMap()`. A `SizeMap` goes in
1828
- `size_map`.
2263
+ RGB color). A `ColorMap` goes in `color_map`, not `color`. Values go through the series'
2264
+ color axis wherever a series maps them: points (Scatter, Strip, Swarm `color` and
2265
+ `edge_color`; the markers of Line, Errorbar, Stem and Regression), cells, categories (Box,
2266
+ Bar, Violin `color`). A box's outliers are computed, so its `marker_color` and
2267
+ `marker_edge_color` take colors only. A line's `color` and every `edge_color` of bars,
2268
+ boxes, violins, pies and hexagons are one color. Values elsewhere are errors that name the
2269
+ setting.
2270
+
2271
+ `size` takes a diameter (a length), diameters per point (px), or values per point mapped
2272
+ through the size axis when the series has a `size_map` or a `size_axis`; `"density"` is
2273
+ always mapped (default sizes `SizeMap()`). A `SizeMap` goes in `size_map`. `marker_size`
2274
+ (lines, error bars, stems, regressions, box outliers) is diameters in px only: those
2275
+ series have no size axis.
1829
2276
 
1830
2277
  Aliases, on every class with the setting: `c` = `color`, `s` = `size`, `cmap` =
1831
2278
  `color_map`, `smap` = `size_map` (also in style keys). Giving both names is an error.
@@ -1833,7 +2280,7 @@ Aliases, on every class with the setting: `c` = `color`, `s` = `size`, `cmap` =
1833
2280
  ### Point density
1834
2281
 
1835
2282
  ```python
1836
- p.scatter(x, y, c="density", order="density") # densest points drawn last
2283
+ p.scatter(x, y, c="density", draw_order="density") # densest points drawn last
1837
2284
  p.scatter(x, y, c=pl.Density(adjust=0.5, normalize="max"), cmap="magma")
1838
2285
  pl.Density(bandwidth="scott", adjust=1.0, normalize="pdf", method="auto", grid=512)
1839
2286
  ```
@@ -1847,14 +2294,15 @@ on the axis positions (log axes in log space); NaN points get NaN. `normalize`:
1847
2294
  under automatic limits. `method`: `"exact"` (the sum over all points, multithreaded in
1848
2295
  C, equal to scipy's), `"grid"` (binned, blurred and read back, about 1e-4 relative) or
1849
2296
  `"auto"` (exact up to 20,000 points). A `Density` (or `"density"`) is accepted by
1850
- `color`, `edge_color`, `size` (through `size_map`, default `SizeMap()`), `alpha` (mapped
1851
- linearly to `alpha_range`, default (0.2, 1)) and `order`; one object computes each
2297
+ `color`, `edge_color`, `size` (through the size axis, default `SizeMap()`), `alpha` (mapped
2298
+ linearly to `alpha_range`, default (0.2, 1)) and `draw_order`, and by `marker_color` and
2299
+ `marker_edge_color` of Line (one line), Errorbar, Stem and Regression; one object computes each
1852
2300
  series' own density, cached until a setting changes, and exposed as
1853
2301
  `series.stats["density"]`. The colorbar label defaults to `"density"`.
1854
2302
 
1855
2303
  ### Drawing order
1856
2304
 
1857
- `order` on scatter, strip and swarm: `None` (call order), `"density"` (ascending: the
2305
+ `draw_order` on scatter, strip and swarm: `None` (call order), `"density"` (ascending: the
1858
2306
  densest points are drawn last), `"-density"`, or sort keys per point (ascending; give
1859
2307
  `-z` for descending). Every per-point column (positions, colors, sizes, markers, opacities)
1860
2308
  is reordered together; the sort is stable and NaN keys come first. Setting `color` to a
@@ -1863,7 +2311,8 @@ density does not reorder by itself.
1863
2311
  ### Number formats
1864
2312
 
1865
2313
  One format applies wherever a number becomes text: `tick_format` (plot and colorbar
1866
- axes) and `label_format` (heatmaps).
2314
+ axes) and `value_label_format` (value labels of bars, histograms, heatmaps, contours and
2315
+ pies).
1867
2316
 
1868
2317
  | Format | 1234.5, 0.05, −2 as one label set |
1869
2318
  |---|---|
@@ -1882,7 +2331,7 @@ to the next power is written in it (`9.96` at 2 digits → `10`). NaN gives an e
1882
2331
  Format strings and functions get the raw value; separators, minus and affixes then apply
1883
2332
  to the numbers in their result (rich content is used as is).
1884
2333
 
1885
- Inherited settings (figure → plot → axis, colorbar or heatmap):
2334
+ Inherited settings (figure → plot → axis; series → its color axis):
1886
2335
 
1887
2336
  | Setting | Default | Values |
1888
2337
  |---|---|---|
@@ -1903,59 +2352,413 @@ Inherited settings (figure → plot → axis, colorbar or heatmap):
1903
2352
  | `plus` | 0.51 |
1904
2353
  | `cross` | 0.5754 |
1905
2354
 
1906
- Aliases: `triangle`, `o`, `s`, `d`, `^`, `v`, `<`, `>`, `+`, `x`. A `pdf_io.Path` or SVG
2355
+ Aliases: `triangle`, `o`, `s`, `d`, `^`, `v`, `<`, `>`, `+`, `x`. A `vec_io.Path` or SVG
1907
2356
  path data in a unit box centred on the origin also works. `pl.register_marker(name, path)`
1908
- adds a shape (its area measured from the outline); `pl.marker_path(name)` returns a path
1909
- for pdf_io's `draw_markers`; `pl.marker_area(name)` its area.
2357
+ adds a shape (its area measured from the outline); `plot_io.markers.marker_path(name)` returns a path
2358
+ for vec_io's `draw_markers`; `plot_io.markers.marker_area(name)` its area.
1910
2359
 
1911
2360
  ## 8. Output
1912
2361
 
1913
2362
  ```python
1914
2363
  fig.save(path, **options) # .pdf, .png, .jpg/.jpeg, .jxl, .avif
1915
2364
  fig.to_bytes(format="pdf", **options)
1916
- fig.draw(canvas, x=0, y=0) # on any pdf_io canvas; returns (width, height) in px
2365
+ fig.draw(canvas, x=0, y=0) # on any vec_io canvas (its document's fonts); returns (width, height) in px
1917
2366
  fig.size() # (width, height) in px
1918
2367
  p.save(path, …) p.to_bytes(…) p.draw(canvas, …) # one plot alone, at its size in the figure
1919
2368
  ```
1920
2369
 
1921
- Options: `dpi` (images, default 192: two image pixels per px), `background` (default the figure's; unset is
1922
- transparent, white in JPEG), `quality` (the figure's `quality` when not given; JPEG, default 90; JPEG XL and AVIF,
1923
- default lossless; in a PDF, of rasterized content, default lossless), and pdf_io `Document` arguments: `title`, `author`, `compress`, `compression`,
1924
- `system_fonts`, `font_dirs`, `color_mode`, `pdf_a`, … JPEG XL output (`.jxl`) needs
1925
- libjxl, AVIF output (`.avif`) libavif 1.x. Images inside a PDF (rasterized series, heatmaps) are stored losslessly or as
1926
- JPEG (`quality`), never as JPEG XL, so every PDF reader shows them. `simplify` culls hidden content in PDF output only: PNG, JPEG and
1927
- JPEG XL output draw everything (rasterizing hidden content costs less than culling it,
1928
- and the pixels are the same), and dense lines are still decimated. A plot
1929
- saved alone keeps its size in the figure (axes or box, by `align`), its title, legend and
1930
- attached colorbars; its limits come from its own series.
2370
+ The figure is drawn once on a page of a vec_io document in px; each output is made from
2371
+ it with its own options:
2372
+
2373
+ | Options | Of |
2374
+ |---|---|
2375
+ | `title`, `author`, `subject`, `keywords`, `creator`, `creation_date`, `pdf_a`, `color_mode`, `ink_limit`, `icc_profile`, `base_dir` | the document (vec_io `Document`) |
2376
+ | `font_dirs`, `system_fonts` | the fonts text is shaped and embedded with ([fonts](#1-conventions)) |
2377
+ | `quality` | the figure's `quality` when not given: 1–100, `"lossless"` (not JPEG) or `"auto"`, the default: PNG 90, a palette of at most 256 colors; JPEG 90; JPEG XL, AVIF and rasterized content in a PDF lossless |
2378
+ | `compression` | `"fast"`, `"balanced"` (default), `"best"`: the encoder's effort (PDF streams and images, PNG, JPEG, JPEG XL, AVIF) |
2379
+ | `simplify` | the output's `simplify` for content without its own (series have theirs, below) |
2380
+ | `compress`, `font_hinting` | PDF: compressed streams (default) or a readable file; TrueType hinting kept in embedded subsets (default: left out) |
2381
+ | `dpi`, `background` | images: resolution (default 192: two image pixels per px); a color under the figure (default the figure's, white; `None` is transparent, white in JPEG) |
2382
+
2383
+ JPEG XL output (`.jxl`) needs libjxl, AVIF output (`.avif`) libavif 1.x. Images inside a
2384
+ PDF (rasterized series, heatmaps) are stored losslessly or as JPEG (`quality`), never as
2385
+ JPEG XL, so every PDF reader shows them. Fonts are embedded subsets without hinting: a
2386
+ typical figure's text adds a few KB per face. A plot
2387
+ saved alone keeps its size in the figure (axes or box, by `align`), its limits and ticks
2388
+ (those of its shared axes too), its title, legend and attached colorbars, and shows its
2389
+ outer tick labels ([layout](#layout)).
2390
+
2391
+ PNG quality: by default (`quality="auto"`) PNGs are palette images at quality 90: the plot's
2392
+ own colors stay exact, only antialiasing and gradients are approximated, and an image 256
2393
+ colors cannot render well enough stays lossless. The 21 example PNGs total 0.74 MB this way,
2394
+ 1.57 MB with `quality="lossless"` and 1.38 MB lossless with `compression="best"` (same pixels,
2395
+ slower). Notebook previews are lossless.
1931
2396
 
1932
2397
  ### Large data
1933
2398
 
1934
- * Series map their data to page coordinates in C (pdf_io `arrays.scaled`) and draw with
1935
- one bulk pdf_io call (markers, lines, areas, segments).
1936
- * `simplify` (series, plot or figure; default `"auto"`) is passed to pdf_io: `"auto"`
1937
- decimates lines with many points per pixel column and culls markers that later markers
1938
- hide when that pays off (pdf_io decides per call from the data); `True` or a dpi always
1939
- simplifies at that resolution; `False` never.
1940
- * `rasterize=True` or a dpi draws the series as an image inside the PDF; axes and text
1941
- stay vectors.
2399
+ * Series map their data to page coordinates in C (`kernels.scaled`) and draw with
2400
+ one bulk vec_io call (markers, lines, areas, segments).
2401
+ * `simplify` (series, plot or figure; default `"auto"`) goes to each of the series' vec_io
2402
+ calls, and vec_io applies it per output. PDF: `"auto"` decimates lines with many points
2403
+ per pixel column and culls markers that later markers hide when that pays off (vec_io
2404
+ decides per call from the data); `True` or a dpi always simplifies at that resolution;
2405
+ `False` never. PNG, JPEG, JPEG XL and AVIF draw everything (rasterizing hidden content
2406
+ costs less than culling it, and the pixels are the same) and decimate lines for their
2407
+ resolution, unless `False`.
2408
+ * `rasterize=True` or a dpi draws the series in a vec_io group the PDF holds as an image;
2409
+ axes and text stay vectors. Image output draws the group as vectors at its own
2410
+ resolution.
1942
2411
 
1943
2412
  Timings (`tools/bench.py`, 8 threads, PDF written):
1944
2413
 
1945
2414
  | Case | Time |
1946
2415
  |---|---|
1947
- | `import plot_io` (pdf_io included) | 0.04 s |
1948
- | empty figure, 4 plots with ticks and labels | 0.004 s |
2416
+ | `import plot_io` (vec_io included) | 0.06 s |
2417
+ | empty figure, 4 plots with ticks and labels | 0.005 s |
1949
2418
  | scatter, 100k points, one color | 0.02 s |
1950
- | scatter, 1M points, colors from a `ColorMap` | 0.71 s |
1951
- | line, 1M points (`simplify=False` / `True`) | 0.09 s / 0.07 s |
2419
+ | scatter, 1M points, colors from a `ColorMap` | 0.25 s |
2420
+ | scatter, 1M points, `c=values`, PDF / PNG at 150 dpi | 0.56 s / 0.43 s |
2421
+ | line, 1M points (`simplify=False` / `True`) | 0.08 s / 0.03 s |
1952
2422
  | box plots, 10 categories × 1M values | 0.09 s |
1953
- | heatmap 1000 × 1000 (`image`) with a colorbar | 0.11 s |
1954
- | heatmap 200 × 200, uneven cells (`cells`) | 0.03 s |
1955
- | scatter, 1M points, `rasterize=300` | 0.66 s |
2423
+ | heatmap 1000 × 1000 (`image`) with a colorbar | 0.06 s |
2424
+ | heatmap 200 × 200, uneven cells (`cells`) | 0.04 s |
2425
+ | scatter, 1M points, `rasterize=300` | 0.22 s |
1956
2426
  | `simplify="auto"` on 1M points it does not cull: overhead | < 0.01 s |
1957
2427
 
1958
- ## 9. Styles
2428
+ ## 9. Genome tracks
2429
+
2430
+ ```python
2431
+ fig = pl.Tracks("chr2:143,120,001-143,780,000", width="5in")
2432
+ fig.hic(gwseq_io.open("cells.hic"), y_axis={"label": "Hi-C"}, depth=500_000)
2433
+ fig.gtf(gwseq_io.open("gencode.gtf.gz"), gene_type="protein_coding")
2434
+ fig.bed(gwseq_io.open_peaks("sites.tsv"), y_axis={"label": "Sites"})
2435
+ sets = fig.track(stacked=True) # one track, a named row per file
2436
+ for c in ("con", "pio"):
2437
+ sets.bed(gwseq_io.open_peaks(f"{c}.tsv"), name=c)
2438
+ p = fig.track(y_axis={"label": "A/B"}) # an empty track: series overlaid
2439
+ before = p.bigwig(gwseq_io.open("before.bw"), name="before", color="sky", fill_to=False)
2440
+ p.bigwig(gwseq_io.open("after.bw"), name="after", color="rose", fill_to=before)
2441
+ fig.bigwig(gwseq_io.open("atac.bw"), y_axis={"label": "ATAC"})
2442
+ fig.vline(143_400_000) # through every track and the gaps
2443
+ fig.save("locus.pdf")
2444
+ fig.save("other.pdf", region=("chr2", 80_000_000, 81_000_000))
2445
+ ```
2446
+
2447
+ Genome tracks are made of general pieces:
2448
+
2449
+ * **A tracks figure.** `pl.Tracks(region, **settings)` is a `Figure` with
2450
+ `layout="tracks"` ([§2](#arrangement)): one column of plots, top to bottom in creation
2451
+ order, sharing x (`share_x="all"`, tick labels and the axis title under the bottom plot
2452
+ only), `spacing` 0, `width` 480 px. Its `region`, `unit`, `unit_in` and `origin` go to
2453
+ `fig.x_axis`, the settings of every plot's x axis ([figure axes](#figure-axes)), with
2454
+ `scale="genome"`; the other keywords are the figure's.
2455
+ * **Tracks.** A `Track` is a plot preset: a `height` from its content, `space_above` it,
2456
+ axis lines left and bottom (Hi-C: bottom only), at most 4 y ticks and the y axis'
2457
+ `label` in the row band (`label_position="band"`, `label_pad="0.5em"`). `fig.track(**settings)`
2458
+ returns an empty one; a plot type called on the figure (`fig.bigwig`, `fig.bed`,
2459
+ `fig.genes`, `fig.gtf`, `fig.hic`, also `fig.line`, …) adds a track holding it and returns
2460
+ the series (`.plot` is the track; the track's settings, `title`, `x_axis` and `y_axis`
2461
+ go to it, and
2462
+ `name` names the series, its legend entry, as everywhere). Called on a track
2463
+ (`p.bigwig(…)`, `p.line(…)`, `p.hline(…)`), plot types overlay in it.
2464
+ * **The genome scale.** An x axis with `scale="genome"` is linear in bp: its limits are its
2465
+ `region` (less its `origin`), without padding, its tick labels in bp, kb or Mb, its
2466
+ automatic label the chromosome (`chr2 (Mb)`). A genome series asks its x axis for it
2467
+ when the axis has no scale of its own, so the genome series work on any plot too
2468
+ (`pl.Plot().bigwig(reader, region=…)`: the series' own `region`).
2469
+ * **Genome layers.** `bigwig`, `bed`, `genes`, `gtf` and `hic` are plot types like the
2470
+ others, drawn with the shared geoms: a signal's bins as a step line, a band and bars;
2471
+ intervals and gene models as rectangles, lines and names; contacts as a grid of cells
2472
+ under a 45° transform.
2473
+ * **Row labels, groups, lines through rows** are figure features ([§2](#rows)):
2474
+ the y axis' `label` is a row label lined up across the tracks, `fig.group(first, last, label=…,
2475
+ letter=…)` labels consecutive tracks (with x tick labels under the last one), and
2476
+ `fig.vline(x, rows=…)`, `fig.vspan(x0, x1, rows=…)` run through the tracks and the gaps.
2477
+
2478
+ Details:
2479
+
2480
+ * **Region.** `region` is a string, 1-based and inclusive
2481
+ (`"chr2:143,120,001-143,780,000"`; positions may carry a unit: `"chr1:1.2M-1.5M"`,
2482
+ `"chr1:500kb-2Mb"`, with `k`, `M`, `G` and an optional `b`, any case, and `,` or `_`
2483
+ between thousands), a `(chr, start, end)` tuple or list (0-based, half-open; the same
2484
+ position strings), or a mapping with `chr`, `start` and `end`; `plot_io.genome.parse_region` gives the
2485
+ `Region` (`chr`, `start`, `end`). A series reads its own `region`, else its x axis'.
2486
+ Data are read when the figure is drawn, for the region drawn: `save`, `to_bytes`, `draw`
2487
+ and `size` take `region=` to draw another one (it replaces `fig.x_axis`'s region for
2488
+ that call).
2489
+ * **x axis.** Ticks under every track (but a Hi-C triangle with `direction="down"`), tick
2490
+ labels and the axis label (`chr2 (Mb)`) under the bottom track; a group's last track has
2491
+ tick labels too; `fig.set(label_outer=False)` labels every track. `unit` (`auto`, `bp`,
2492
+ `kb`, `Mb`) and `unit_in` (`"label"`: `chr2 (Mb)` under `143.2 143.3 …`; `"ticks"`:
2493
+ `-500kb 0 500kb`) set the labels; `tick_format="chr:pos"` writes positions
2494
+ (`chr2:143,250,000`, in bp with `,` between thousands unless `unit` is set:
2495
+ `chr2:143.25Mb`), the position itself even with an `origin`, and leaves the automatic
2496
+ label out; `fig.x_axis(label=…)` replaces the label, and in a
2497
+ string `{chr}`, `{unit}`, `{start}`, `{end}` are filled in (`""`: none). `origin` (a
2498
+ position, `"center"`, `"start"` or `"end"` of the region) is drawn at 0: every series on
2499
+ the axis is drawn less it ([transforms](#5-series)), and limits, ticks and decorations
2500
+ are distances from it (`fig.vline(0)`, `fig.vspan(-1000, 1000)`); a region given to
2501
+ `fig.vspan` is in positions.
2502
+ * **y axis.** An interval track's y axis has a tick per named series (`fig.bed(…,
2503
+ name=…)`; each `name` of a `stacked` track) at the middle of its rows, the name as its
2504
+ label; without names, and on Hi-C tracks, the y axis is hidden (`y_axis(visible=True)`
2505
+ shows it).
2506
+ * **Heights.** A track's `height`: a length, a share (`"1fr"`, of the room the fixed heights
2507
+ leave in a figure of given height, `reference="figure"`), or `auto`: the Hi-C triangle's
2508
+ height (square cells; `max_height`, a length or a percentage of the width such as
2509
+ `"33%"`, caps it, and `fit` clips the distances above or squashes the triangle), the rows
2510
+ of intervals × `row_height` plus the y axis padding above and below, or `auto_height`
2511
+ for signals. The figure height follows. `space_above` is the space above a track:
2512
+ `auto_space_above` above every track but the first.
2513
+ * **Stacked intervals.** A track with `stacked=True` puts each interval series on rows of
2514
+ its own, top to bottom, named left of its rows; they take no legend entries.
2515
+ * **Bins.** `bins` of `bigwig` and `hic`: a width on the axes (`"0.5px"`, the default: two
2516
+ bins per px of the axes width; Hi-C: the finest resolution whose cells are at least that
2517
+ wide), a size (`"10kb"`, `"5000bp"`, `"5000d"`), or a count (`200`). A size is read on
2518
+ the genome-wide grid of that size: the region grows outward to it
2519
+ (`snap_to_grid="expand"`), and the first and last bins are then cut to the region. A
2520
+ count cuts the region itself into that many bins. The bins (and Hi-C `height="auto"`, interval rows) follow the axes width the
2521
+ layout places: with the default `reference="axes"` it is `width`, so each file is read
2522
+ once per draw; with `reference="plot"` or `"figure"`, the data are read again for the
2523
+ width the first round places (reads are cached by their bins).
2524
+ * **Shared y.** `share_y=other_track` on a track, or `fig.set(share_y="bigwig")` to put
2525
+ every track with a `bigwig` series on one scale (a figure's `share_x`/`share_y` takes a
2526
+ plot type's name).
2527
+
2528
+ ### Readers
2529
+
2530
+ plot_io does not import gwseq_io: it reads any object with the methods of gwseq_io's
2531
+ readers, recognised by their `type` attribute (`"bigwig"`, `"bigbed"`, `"bed"`, `"peaks"`,
2532
+ `"gtf"`, `"gff3"`, `"hic"`), else by their methods. The calls, which another reader can implement:
2533
+
2534
+ | Data | Methods called |
2535
+ |---|---|
2536
+ | signal (bigWig; the coverage of bigBed, BED and peaks readers) | `read_values([(chr, start, end)], bin_count=n, bin_mode=…, def_value=…, zoom="auto")`, or with `bin_size=b, snap_to_grid="expand"` and the row's bounds from `resolve_regions([(chr, start, end)], bin_size=b, snap_to_grid="expand")` (without it, `snap_to_grid=False, full_bin=True`): one row of values |
2537
+ | intervals (bigBed, BED, peaks) | `read_entries([(chr, start, end)], as_cols=True, col_count=…)`: a dict (or a list of one dict) of columns; `col_count` from `auto_sql` when the reader has it |
2538
+ | annotation (GTF, GFF3) | `read_transcripts([(chr, start, end)], as_cols=True, gene_type=…, transcript_type=…)`: a dict (or a list of one dict) of transcript columns: `start`, `end`, `strand`, `transcript_id`, `transcript_name`, `gene_id`, `gene_name`, `cds_start`, `cds_end` (−1 when non-coding), `exon_starts`, `exon_ends`, `exon_offsets` |
2539
+ | contacts (Hi-C) | `bin_sizes`, `normalizations`, `read_values((chr, start, end), bin_size=b, snap_to_grid="expand", normalization=…, matrix_type=…, max_distance=…)` (or `bin_count=n` instead of the first two): a square matrix; bounds from `resolve_regions((chr, start, end), bin_size=b, snap_to_grid="expand")["rows"]` |
2540
+
2541
+ Results are read as buffers (numpy arrays included) without importing numpy. A path
2542
+ instead of a reader raises `TypeError` (open it with `gwseq_io.open`, or
2543
+ `gwseq_io.open_peaks` for a TSV of locations), as do BAM and CRAM readers (pile the reads
2544
+ up into a bigWig first). A reader's error is raised with the track's label in the
2545
+ message.
2546
+
2547
+ ### BigWig
2548
+
2549
+ ```python
2550
+ pl.BigWig(reader=None, plot=None, *, x=None, y=None, **settings)
2551
+ ```
2552
+
2553
+ A step line along the bins, filled to `fill_to`. `reader` is a signal reader, a function
2554
+ `f(chr, start, end, bins)` returning the values, or `None` with `y` (values evenly over
2555
+ the region) and optionally `x` (bin centres, or n + 1 edges, in bp). The color is black
2556
+ when the series is alone in its track, palette colors when overlaid. `fill_to=<series>`
2557
+ fills between two signals, each part in the fill color of the series on top. For more,
2558
+ the track's `fill_mode` fills between all its signals, in place of their `fill_to`:
2559
+ `"in_between(up)"` (or `"in_between"`) fills each band between two neighbouring signals
2560
+ in the color of the one just above, `"in_between(down)"` of the one just below;
2561
+ `"in_between(max)"` fills from the lowest signal to the highest in the color of the top
2562
+ one, `"in_between(min)"` of the bottom one. The colors follow wherever the order changes
2563
+ (lines get points where they cross), and 0 is not kept on the y axis:
2564
+
2565
+ ```python
2566
+ t = fig.track(y_axis={"label": "Lamin A/C"}, fill_mode="in_between(up)")
2567
+ t.bigwig(neo_reader, name="Neo", color="sky")
2568
+ t.bigwig(pax7_reader, name="Pax7", color="rose")
2569
+ ```
2570
+
2571
+ <!-- settings:BigWig -->
2572
+ | Setting | Default | Meaning |
2573
+ |---|---|---|
2574
+ | `region` | — | The region read: `"chr2:143,120,001-143,780,000"` (1-based, inclusive), `(chr, start, end)` (0-based, half-open) or a mapping; unset: the x axis' `region`. |
2575
+ | `bins` | '0.5px' | A bin count over the region (exactly, not on a grid); a bin size (`"10kb"`, `"5000bp"`), read on the genome-wide grid of the size (the row grown to it, then cut to the region); or a bin width on the axes (`"0.5px"`: two bins per px, read as a count). |
2576
+ | `bin_mode` | 'mean' | Reduction per bin: `mean`, `max` (keeps narrow peaks), `min`, `sum`, … (gwseq_io's). |
2577
+ | `def_value` | 0.0 | Value of bases no record covers; NaN breaks the line there. |
2578
+ | `kind` | 'step' | `step` (a step line along the bins), `line` (through the bin centres) or `bar` (one rectangle per bin). |
2579
+ | `fill_to` | 0.0 | Fill between the signal and a value, another series of the track (colored by whichever is above), or `False`. |
2580
+ | `fill` | 0.2 | Fill (to `fill_to`): an opacity of the line color, `True` (opaque), a color, or `False`. |
2581
+ | `color` | — | Line color; default black alone in its track, the next palette color when overlaid. |
2582
+ | `transform` | — | A function applied to each value (log, scaling). |
2583
+ | `name` | — | Legend entry; unset: not in the legend. |
2584
+ | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2585
+ | `z` | — | Drawing order (higher on top); default: call order. |
2586
+ | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
2587
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
2588
+ | `line_width` | inherited (0.75) | Line width. Length. |
2589
+ | `text_color` | inherited ('black') | Text color. |
2590
+ | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
2591
+ | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2592
+ | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2593
+ | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2594
+ | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2595
+
2596
+ Groups: `FillStyle`, `Font`.
2597
+ <!-- /settings -->
2598
+
2599
+ ### Bed and Genes
2600
+
2601
+ ```python
2602
+ pl.Bed(reader, plot=None, **settings)
2603
+ pl.Genes(reader, plot=None, **settings) # Bed with kind="genes", rows expanded, names on,
2604
+ # filled solid without outlines
2605
+ ```
2606
+
2607
+ `reader` is an interval reader, or the columns themselves: a dict, a DataFrame, or rows
2608
+ (dicts, or tuples in BED order). Used columns: `chr` (when given, rows of other
2609
+ chromosomes are left out), `start`, `end`, `name`, `score`, `strand`, `thickStart`,
2610
+ `thickEnd`, `itemRgb` (`reserved` in bigBeds), `blockCount`, `blockSizes`, `blockStarts`.
2611
+ `genes` draws each BED12 model as a line, thin boxes for UTRs and thick boxes for coding
2612
+ exons, chevrons on introns (`strand`), and its name in italics with a strand mark
2613
+ (`Pcsk2 ›`). Names go left of their feature and are dropped where they would collide;
2614
+ with `rows="expand"` packing leaves room for them (`names=False`: none). `name_region` names only the
2615
+ features overlapping it (a locus within a wider view), and packing then makes room only
2616
+ for those names. Features are outlined in their color (`outline`, `line_width`) over their
2617
+ `fill` (an opacity of their color, 0.3; `False` for outlines only), the outline inside the feature's extent: a
2618
+ feature narrower than two borders is one line, `line_width` wide. `recolor` snaps the features' colors
2619
+ (`itemRgb` ones included) to the named colors (`"blue 0.4"`, §7): `True` takes the
2620
+ closest of all shades, a level such as `0.4` the closest color's shade at that level, so
2621
+ every feature has the same lightness.
2622
+
2623
+ <!-- settings:Bed -->
2624
+ | Setting | Default | Meaning |
2625
+ |---|---|---|
2626
+ | `region` | — | The region read: `"chr2:143,120,001-143,780,000"` (1-based, inclusive), `(chr, start, end)` (0-based, half-open) or a mapping; unset: the x axis' `region`. |
2627
+ | `kind` | 'boxes' | `boxes` (intervals, 8/13.2 of a row high: 8 px in the default row) or `genes` (BED12 models: exons as high, UTRs half, introns). |
2628
+ | `rows` | 'collapse' | `collapse`: one row; `expand`: overlapping features (and their labels) packed onto rows. |
2629
+ | `min_width` | 0.75 | Narrowest drawn feature (1-bp sites stay visible). Length. |
2630
+ | `color` | 'black' | A color, `"item_rgb"` (the `itemRgb` column) or `"score"` (the `score` column through `color_map`). |
2631
+ | `recolor` | False | Replace each feature's color by the closest named color (`True`: the closest shade; a level 0–1: the closest color's shade at that level); `False`: as given. Not with `color="score"`. |
2632
+ | `names` | False | Feature names (`name`) left of the features, dropped where they collide. |
2633
+ | `name_region` | — | Only features overlapping this region (as `region` takes it) get names; `None`: all. |
2634
+ | `strand` | False | Strand chevrons on boxes and introns. |
2635
+ | `outline` | True | Outline features in their color (`line_width` wide). |
2636
+ | `fill` | 0.3 | Fill of the features: an opacity of their color (times `alpha`), `True` (opaque), a color, or `False` (outlines only). |
2637
+ | `row_height` | '1.2em' | Height of a row; the track's automatic height is rows × it, plus the y axis padding. Length; `%`: of the font size. |
2638
+ | `name_font_size` | '0.85em' | Font size of feature names. Length; `%`: of the font size. |
2639
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
2640
+ | `color_limits` | — | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
2641
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
2642
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
2643
+ | `name` | — | Legend entry; unset: not in the legend. |
2644
+ | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2645
+ | `z` | — | Drawing order (higher on top); default: call order. |
2646
+ | `line_width` | inherited (0.75) | Line width. Length. |
2647
+ | `text_color` | inherited ('black') | Text color. |
2648
+ | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
2649
+ | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2650
+ | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2651
+ | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2652
+ | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2653
+
2654
+ Groups: `FillStyle`, `TextStyle` (`name_`), `Font`.
2655
+ <!-- /settings -->
2656
+
2657
+ `Genes` (only its own defaults):
2658
+
2659
+ <!-- settings:Genes -->
2660
+ | Setting | Default | Meaning |
2661
+ |---|---|---|
2662
+ | `kind` | 'genes' | `boxes` (intervals, 8/13.2 of a row high: 8 px in the default row) or `genes` (BED12 models: exons as high, UTRs half, introns). |
2663
+ | `rows` | 'expand' | `collapse`: one row; `expand`: overlapping features (and their labels) packed onto rows. |
2664
+ | `names` | True | Feature names (`name`) left of the features, dropped where they collide. |
2665
+ | `strand` | True | Strand chevrons on boxes and introns. |
2666
+ | `outline` | False | Outline features in their color (`line_width` wide). |
2667
+ | `fill` | True | Fill of the features: an opacity of their color (times `alpha`), `True` (opaque), a color, or `False` (outlines only). |
2668
+
2669
+ Groups: `FillStyle`.
2670
+ <!-- /settings -->
2671
+
2672
+ ### Gtf
2673
+
2674
+ ```python
2675
+ pl.Gtf(reader, plot=None, **settings) # Genes from a GTF or GFF3 reader
2676
+ ```
2677
+
2678
+ `reader` is a GTF or GFF3 reader (`gwseq_io.open("gencode.gtf.gz")`, bgzipped and indexed;
2679
+ `gwseq_io.index_gtf` makes one from any GTF), or BED12 columns as `Genes` takes them. The
2680
+ transcripts overlapping the region come whole, with their exons outside it. With
2681
+ `model="gene"` each gene is one model: its transcripts' exons merged, coding from the
2682
+ first CDS start to the last CDS end (the stop codon included), named by `gene_name`;
2683
+ `model="transcript"` draws every transcript, named by `transcript_name`. An id names what
2684
+ has no name. `gene_type` and `transcript_type` keep those biotypes. A `Bed` or `Genes`
2685
+ given a GTF reader raises `TypeError` pointing here.
2686
+
2687
+ `Gtf` (only its own settings and defaults):
2688
+
2689
+ <!-- settings:Gtf -->
2690
+ | Setting | Default | Meaning |
2691
+ |---|---|---|
2692
+ | `model` | 'gene' | `gene`: one model per gene, its transcripts' exons merged and coding from the first CDS start to the last CDS end, named by `gene_name`; `transcript`: one per transcript, named by `transcript_name` (ids where there is no name). |
2693
+ | `gene_type` | — | Gene biotypes kept (`"protein_coding"`, a list); `None`: all. |
2694
+ | `transcript_type` | — | Transcript biotypes kept; `None`: all. |
2695
+ <!-- /settings -->
2696
+
2697
+ ### HiC
2698
+
2699
+ ```python
2700
+ pl.HiC(reader, plot=None, **settings)
2701
+ ```
2702
+
2703
+ The upper triangle of the contact matrix, the diagonal on the x axis, each cell a
2704
+ diamond: the matrix is drawn as an image under a 45° transform and clipped to the track.
2705
+ `reader` is a Hi-C reader, or a square matrix over the region. `bins="0.5px"` (the
2706
+ default) takes the finest of the reader's `bin_sizes` whose cells are at least 0.5 px wide;
2707
+ the cells of a size (`bins="5kb"`) sit on the file's grid, those past the region cut by
2708
+ the track's edges, and `bins=n` reads n cells over the region exactly. Its color axis' limits default
2709
+ to quantiles of the cells drawn (`color_limits="q:0.01/q:0.99"`), on a log scale
2710
+ (`color_scale="log"`; cells of 0 take the map's low end; cells without a value take
2711
+ `nan_color`, transparent), through the figure's `color_map`.
2712
+
2713
+ <!-- settings:HiC -->
2714
+ | Setting | Default | Meaning |
2715
+ |---|---|---|
2716
+ | `region` | — | The region read: `"chr2:143,120,001-143,780,000"` (1-based, inclusive), `(chr, start, end)` (0-based, half-open) or a mapping; unset: the x axis' `region`. |
2717
+ | `depth` | — | Largest distance shown (bp); default the region's span (the whole triangle). |
2718
+ | `bins` | '0.5px' | A bin count over the region (exactly, from the coarsest resolution giving that many); one of the reader's `bin_sizes` (`"10kb"`), read on its grid (the region grown to it, then cut by the track); or a cell width on the axes (`"0.5px"`): the finest resolution whose cells are at least that wide. |
2719
+ | `normalization` | 'none' | `"none"` or one of the reader's `normalizations`. |
2720
+ | `matrix_type` | 'observed' | `observed`, `oe` (observed / expected) or `expected`. |
2721
+ | `color_map` | inherited ('rainbow_llhh') | The gradient numbers given as colors are drawn with: a `ColorMap`, a map name or colors (alias `cmap`); default: the style's. |
2722
+ | `color_limits` | 'q:0.01/q:0.99' | Limits of the series' color axis, as an axis' `limits`: `"-2/2"`, `"0/max"`, `"q:0.01/q:0.99"`; unset: `"auto"`, the values' range. |
2723
+ | `color_scale` | 'log' | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
2724
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
2725
+ | `nan_color` | — | Color of cells without a value; default: the map's `bad` (transparent). |
2726
+ | `direction` | 'up' | `up`: the apex up; `down`: the triangle hangs from the top. |
2727
+ | `max_height` | — | Largest height of the track: a percentage of its width (`"33%"`) or a length; `None`: the triangle's (square cells). |
2728
+ | `fit` | 'clip' | How the triangle fits a height below its own (`max_height`, or the track's `height`): `clip` keeps square cells and cuts the distances above; `squash` flattens the whole triangle. |
2729
+ | `colorbar` | False | Attach a colorbar to the track. |
2730
+ | `name` | — | Legend entry; unset: not in the legend. |
2731
+ | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2732
+ | `z` | — | Drawing order (higher on top); default: call order. |
2733
+ | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
2734
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
2735
+ | `text_color` | inherited ('black') | Text color. |
2736
+ | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
2737
+ | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2738
+ | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2739
+ | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2740
+ | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2741
+
2742
+ Groups: `Font`.
2743
+ <!-- /settings -->
2744
+
2745
+ ### Tracks
2746
+
2747
+ `pl.Tracks(region=None, **settings)` returns the figure; `Track` has the settings of `Plot`,
2748
+ these added or with other defaults:
2749
+
2750
+ <!-- settings:Track -->
2751
+ | Setting | Default | Meaning |
2752
+ |---|---|---|
2753
+ | `space_above` | 'auto' | Space above the track; `auto`: none for the first track, else `auto_space_above`. Length; `%`: of the font size. |
2754
+ | `height` | 'auto' | Height of the track's axes: a length, a share of the room the fixed heights leave (`"1fr"`, with the figure's height given), or `auto`: Hi-C from its `depth` (square cells), intervals rows × `row_height`, else `auto_height`. |
2755
+ | `auto_height` | '4.5em' | Height of signal and empty tracks with `height="auto"`. Length; `%`: of the font size. |
2756
+ | `auto_space_above` | '0.6em' | The space `space_above="auto"` leaves. Length; `%`: of the font size. |
2757
+ | `stacked` | False | Interval series on rows of their own, top to bottom, each named left of its rows by its `name`. |
2758
+ | `fill_mode` | — | Fill between the track's signals (replacing their `fill_to`): `"in_between(up)"` (or `"in_between"`), each band between two neighbouring signals in the fill color of the one above; `(down)`, of the one below; `(max)`, one band from the lowest signal to the highest in the color of the top one; `(min)`, of the bottom one. `None`: each signal's `fill_to`. |
2759
+ <!-- /settings -->
2760
+
2761
+ ## 10. Styles
1959
2762
 
1960
2763
  A style presets settings: `Figure(style=…)` (also accepted by `pl.Plot` and the series
1961
2764
  classes, which pass it to their figure). Explicit settings always win over the style.
@@ -1969,24 +2772,28 @@ pl.register_style("house", {"font_family": "Helvetica", "Legend.frame": True})
1969
2772
  pl.set_style("house") # figures created afterwards
1970
2773
  with pl.use_style({"font_size": 10}): # figures created inside the block
1971
2774
  ...
1972
- pl.styles() # registered names
1973
- pl.style_settings("house") # the resolved dict (base theme included)
2775
+ pl.styles.names() # registered names
2776
+ pl.styles.settings("house") # the resolved dict (base theme included)
1974
2777
  ```
1975
2778
 
1976
- * **Keys.** Names of inherited settings (`"font_size"`, `"palette"`) or `"Class.name"`
1977
- for any setting of a class: `Figure`, `FigureTitle`, `Plot`, `Title`, `Legend`, `Axis`
1978
- (plot and colorbar axes), `Colorbar`, `Scatter`, `Line`, `Fill`, `Box`, `Heatmap`.
2779
+ * **Keys.** Names of inherited settings (`"font_size"`, `"palette"`), `"Class.name"` for
2780
+ any setting of a class and its subclasses (`Figure`, `FigureTitle`, `Plot`, `Title`,
2781
+ `Legend`, `Axis` (plot, color and size axes), `Colorbar`, every series class, `Series` for
2782
+ all of them, every decoration class, `Decoration` for all of them, the genome classes),
2783
+ or `"Group.member"` for every embedding of a group member (`"Marker.size"`,
2784
+ `"Stroke.line_width"`, `"TextStyle.font_weight"`).
1979
2785
  `"Colorbar.<axis setting>"` (`"Colorbar.tick_direction"`, `"Colorbar.tick_color"`, …)
1980
- applies to colorbar axes only, and `"XAxis.<setting>"`, `"YAxis.<setting>"` to the x or
2786
+ applies to color axes (the colorbars' axes) only, and `"XAxis.<setting>"`, `"YAxis.<setting>"` to the x or
1981
2787
  y axis of plots only; each wins over `"Axis.<setting>"` there.
1982
2788
  Keys starting with `--` are custom variables (`"--accent": "#c00"`), read by
1983
2789
  `var(--accent)`. Values are checked when the style is registered or set.
1984
2790
  * **`"base"`.** A style name or a list of names, applied left to right (later ones win);
1985
2791
  the dict's own keys are applied over them. Registered styles use the same form.
1986
- * **Resolution.** A setting is looked up on the object, then as `"Class.name"` in the
1987
- figure's effective theme, then (inherited settings) up the parent chain and as
1988
- `"name"` in the effective theme, then `DEFAULTS`. The effective theme is `pl.THEME`
1989
- (the inherited defaults) with the expanded style merged over it.
2792
+ * **Resolution.** The cascade of [conventions](#1-conventions): the object's own value,
2793
+ class rules, `"Class.name"` keys along the class hierarchy, the parent (inherited
2794
+ settings), `"Group.member"` keys, the class and group defaults, then the bare name. The
2795
+ effective theme is the inherited defaults (the bare names of `DEFAULTS`) with the
2796
+ expanded style merged over it.
1990
2797
  * **Default.** Without `style`, a figure takes the session style current when it is
1991
2798
  created (`use_style` innermost, else `set_style`), else `"default"`, which adds nothing
1992
2799
  to `DEFAULTS`.
@@ -1995,7 +2802,7 @@ pl.style_settings("house") # the resolved dict (base theme included)
1995
2802
  pads and gaps, from the defaults, the style or set on objects (not the figure size).
1996
2803
  Lengths in `em` follow the scaled font size.
1997
2804
 
1998
- Bundled styles (`pl.styles()`), each the defaults of a library expressed in these
2805
+ Bundled styles (`pl.styles.names()`), each the defaults of a library expressed in these
1999
2806
  settings (colors, fonts, grid, axis lines, ticks, legend and title placement, palette,
2000
2807
  color map, default series looks). They never change plot sizes or the minus sign
2001
2808
  (`style={"base": "matplotlib", "minus": "minus"}` gets matplotlib's).
@@ -2022,30 +2829,49 @@ Vega and Vega-Lite default configs, Chart.js's defaults, plotly's templates and
2022
2829
  documented default properties. What cannot be expressed: legend titles naming a variable
2023
2830
  (series carry no variable names).
2024
2831
 
2025
- ## 10. Errors
2832
+ ## 11. Errors
2026
2833
 
2027
2834
  | Exception | Raised for |
2028
2835
  |---|---|
2029
- | `ValueError` | unknown settings or invalid values; mismatched data lengths; grids whose ids are not rectangles; ids outside the grid or taken; a full `rows` × `cols` arrangement; `width` with `plot_width`; `grid` with `rows`/`cols`; ratios of the wrong length; mixed category and numeric series on an axis; limits outside a scale's domain; a `ColorMap` without `color_values`; heatmap labels on more than 2,500 cells; unknown formats or output options; unknown bin rules or decreasing bin edges; negative pie values; pies with axis series on one plot; `axline` slopes on non-linear axes; decoration positions that are not categories of a category axis |
2836
+ | `NoFontError` (a `ValueError`, `vec_io.text.NoFontError`) | text with no outline font available at all ([fonts](#1-conventions)) |
2837
+ | `ValueError` | unknown settings or invalid values; mismatched data lengths; grids whose ids are not rectangles; ids outside the grid or taken; a full `rows` × `cols` arrangement; `width` with `plot_width`; a grid `layout` with `rows`/`cols`; ratios of the wrong length; mixed category and numeric series on an axis; limits outside a scale's domain; a colorbar without a mapped source, or of a `ColorMap`; `color_map`, `color_limits` or `color_scale` with a shared `color_axis`; shared color axes with different limits or scales; heatmap value labels on more than 2,500 cells; unknown formats or output options, or options of another format (`dpi` for a PDF, `compress` for an image); unknown bin rules or decreasing bin edges; negative pie values; pies with axis series on one plot; `axline` slopes on non-linear axes; decoration positions that are not categories of a category axis |
2838
+
2839
+ ## 12. Modules
2030
2840
 
2031
- ## 11. Modules
2841
+ `pl.__all__` (51 names) is the API. These modules are public too:
2842
+ `plot_io.styles` (`pl.styles`: `names`, `settings`, `register_style`, `set_style`,
2843
+ `use_style`), `plot_io.genome` (`parse_region`, `Region`), `plot_io.markers`
2844
+ (`marker_path`, `marker_area`), `plot_io.color.palettes` (`PALETTE`), and the modules of
2845
+ the types calls return: `plot_io.facets` (`FacetSet`, `LayerSet`), `plot_io.tables`
2846
+ (`SeriesGroup`), `plot_io.colorbar` (`Colorbar`). The others are internal: their names
2847
+ may change in any release.
2032
2848
 
2033
2849
  | Module | Role |
2034
2850
  |---|---|
2035
- | `settings.py` | `Setting`, `Settings` (validation, inheritance, themes), keyword routing, validators |
2036
- | `figure.py`, `plot.py` | `Figure` (arrangement, sizes, output), `Plot`, `Title`, `Legend` |
2851
+ | `settings.py` | `Setting`, `Settings` (validation, the cascade, explain), class rules and `"auto"` rules, keyword routing, validators |
2852
+ | `groups.py` | setting groups (`Font`, `TextStyle`, `Stroke`, `Marker`, `FillStyle`, `NumberFormat`) and their embedding under a prefix |
2853
+ | `defaults.py`, `units.py` | `DEFAULTS`; units, `var()`/`calc()`/`inherit`, `%` referents, `explain` traces |
2854
+ | `spec.py` | a render's specs (the model resolved once, frozen), layout boxes, palette colors and trained color and size axes |
2855
+ | `figure.py`, `plot.py` | `Figure` (arrangement, tracks layout, figure axes, sizes, output), `Plot`, `Title`, `Legend` |
2856
+ | `rows.py` | row labels in a band left of the plots, groups of rows (`FigureGroup`), lines and bands through rows (`FigureVLine`, `FigureVSpan`) |
2037
2857
  | `axis.py`, `scales.py`, `limits.py`, `ticks.py` | axes, scale functions, limits syntax, tick choice and labels |
2038
- | `render.py` | resolution, layout and drawing |
2039
- | `legend.py`, `colorbar.py` | legend and colorbar layout and drawing |
2040
- | `series/` | `Series` base and the series kinds; shared marker drawing; error bars |
2041
- | `slots.py`, `stacking.py`, `labels.py`, `shapes.py` | category slots, stacking, value labels, bulk rectangles and polygons |
2042
- | `stats.py` | bins, densities, contours, LOWESS and swarm layout (pdf_io's C helpers) |
2858
+ | `states.py` | the render's state of each plot: calls, palette, axes and their limits, legend, colorbars |
2859
+ | `layout.py`, `geometry.py` | the box model: bands measured around each plot's axes, the grid solved in rounds, the frozen geometry (`layout.layout(fig, fonts)`: text shaped with a font database, no canvas) |
2860
+ | `render.py` | drawing from the geometry; the page of a px document and its outputs (`doc.to_bytes`, `page.render(…).encode`) |
2861
+ | `mapped.py` | color and size axes (`ColorAxis`, `SizeAxis`): own and shared axes of series, their training |
2862
+ | `legend.py`, `colorbar.py` | legend (with size keys) and colorbar: measured, placed, drawn |
2863
+ | `layers/` | plot types as layers: `base.py` (`Series`, the model of a call; `data=`/`group=`), `core.py` (`Layer`, `Call`, `Table`), `stats.py` (columns from data), `positions.py` (stack, dodge, jitter, swarm, packing), `geoms.py` (the eight geoms: extent, drawing, legend symbol, occupancy, hit area), `pipeline.py` (calls per plot, palette training), `paint.py` (colors, mapped values, markers), `context.py` (drawing context, the x↔y swap); `register_layer` |
2864
+ | `presets/` | the plot types (`Scatter`, `Box`, …): settings, and the layers each draws; error bars |
2865
+ | `labels.py`, `shapes.py`, `seams.py` | value labels, bulk rectangles and polygons, seams between touching outlines |
2866
+ | `stats.py` | bins, densities, contours, LOWESS and swarm layout, adapted to plot_io's needs |
2867
+ | `kernels.py`, `_native/` | the numeric kernels (statistics, scaling, gathering) and their C library `plio`: sources, built binaries, bindings generated from `src/plio_api.h` (see `_native/README.md`) |
2043
2868
  | `decorations.py` | reference lines, spans, text and annotations |
2044
- | `color/` | colors: `values.py` (the `color` validator, named color scales, palette references, alpha, saturation, luminance), `palettes.py` (palettes: the discrete colors series take in turn; registry, ggplot2's hues), `maps.py` (`ColorMap`: gradients numbers are mapped onto; Oklab from pdf_io), `data.py` (bundled map and palette colors) |
2045
- | `sizemaps.py` | `SizeMap`: values to marker diameters |
2046
- | `markers.py`, `lines.py`, `text.py` | marker shapes, line dash styles, rich one-line text |
2869
+ | `color/` | colors: `values.py` (the `color` validator, named color scales, palette references, alpha, saturation, luminance), `palettes.py` (palettes: the discrete colors series take in turn; registry, ggplot2's hues), `maps.py` (`ColorMap`: the gradients of color axes and the palette indices or positions of heatmap cells, evaluated in plot_io's C library), `data.py` (bundled map and palette colors) |
2870
+ | `sizemaps.py` | `SizeMap`: the diameters of size axes |
2871
+ | `markers.py`, `lines.py`, `text.py` | marker shapes, line dash styles, one-line text through `vec_io.text`: shaped lines (memoized in the font database, rich content per render), placed runs drawn as shaped, the title's paragraphs |
2047
2872
  | `styles/` | style registry and expansion; bundled styles (point libraries in `pt`) |
2048
2873
  | `values.py`, `density.py` | values given to `color`/`size` and their rules; `Density` (point density) |
2049
- | `tables.py`, `facets.py` | columns of tables, `group=` splitting (`SeriesGroup`); `facet` |
2874
+ | `tables.py`, `facets.py` | columns of tables, `group=` splitting (`SeriesGroup`); `facet`, `FacetSet`, `LayerSet` |
2050
2875
  | `sharing.py`, `times.py` | shared axes; dates and times on axes |
2051
- | `_backend.py` | the pdf_io calls plot_io relies on |
2876
+ | `genome/` | genome tracks: `layout.py` (`Tracks`, the `Track` preset), `scale.py` (the genome scale: tick labels, label, origin), `tracks.py` (`BigWig`, `Bed`, `Genes`, `Gtf`, `HiC`: layers over stats `region_signal`, `intervals`, `contact_matrix`; registered layers), `sources.py` (reading readers by their methods), `regions.py`, `pack.py` (rows of intervals) |
2877
+ | `_backend.py` | the vec_io calls plot_io relies on (buffer intake, font databases shared between renders, path areas) |