plot-io 0.6.0__tar.gz → 0.8.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 (226) hide show
  1. {plot_io-0.6.0 → plot_io-0.8.0}/API.md +896 -348
  2. plot_io-0.8.0/EXAMPLES.md +1050 -0
  3. plot_io-0.6.0/README.md → plot_io-0.8.0/PKG-INFO +59 -10
  4. plot_io-0.6.0/PKG-INFO → plot_io-0.8.0/README.md +43 -25
  5. {plot_io-0.6.0 → plot_io-0.8.0}/examples/annotated.py +1 -1
  6. {plot_io-0.6.0 → plot_io-0.8.0}/examples/bars.py +3 -3
  7. plot_io-0.8.0/examples/colorbars.py +42 -0
  8. plot_io-0.8.0/examples/dots.py +44 -0
  9. {plot_io-0.6.0 → plot_io-0.8.0}/examples/error_bars.py +1 -1
  10. {plot_io-0.6.0 → plot_io-0.8.0}/examples/groups.py +1 -1
  11. {plot_io-0.6.0 → plot_io-0.8.0}/examples/shared_colorbar.py +1 -1
  12. plot_io-0.8.0/examples/shared_legend.py +50 -0
  13. {plot_io-0.6.0 → plot_io-0.8.0}/examples/shared_sizes.py +4 -5
  14. plot_io-0.8.0/examples/titles.py +45 -0
  15. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/__init__.py +16 -18
  16. plot_io-0.8.0/plot_io/_backend.py +46 -0
  17. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/README.md +26 -16
  18. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/_api.py +57 -27
  19. plot_io-0.8.0/plot_io/_native/bin/linux-aarch64.so +0 -0
  20. plot_io-0.8.0/plot_io/_native/bin/linux-x86_64.so +0 -0
  21. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/bin/macos-arm64.dylib +0 -0
  22. plot_io-0.8.0/plot_io/_native/bin/windows-arm64.dll +0 -0
  23. plot_io-0.8.0/plot_io/_native/bin/windows-x86_64.dll +0 -0
  24. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/kernels.py +28 -38
  25. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/manifest.json +12 -12
  26. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/alloc.c +2 -63
  27. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/colormap.c +15 -18
  28. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/math.c +17 -120
  29. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/plio.h +15 -20
  30. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/plio_api.h +53 -25
  31. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/plot.c +40 -70
  32. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/signatures.c +15 -15
  33. plot_io-0.8.0/plot_io/_native/src/sort.c +59 -0
  34. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/stats.c +96 -125
  35. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/axis.py +21 -13
  36. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/color/maps.py +12 -19
  37. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/color/palettes.py +2 -2
  38. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/color/values.py +7 -6
  39. plot_io-0.8.0/plot_io/colorbar.py +1200 -0
  40. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/decorations.py +37 -36
  41. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/defaults.py +138 -79
  42. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/density.py +1 -1
  43. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/facets.py +10 -17
  44. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/figure.py +188 -87
  45. plot_io-0.8.0/plot_io/genome/pack.py +27 -0
  46. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/genome/regions.py +8 -2
  47. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/genome/sources.py +91 -38
  48. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/genome/tracks.py +81 -93
  49. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/geometry.py +81 -7
  50. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/groups.py +31 -20
  51. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/kernels.py +59 -87
  52. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/labels.py +16 -9
  53. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/__init__.py +13 -6
  54. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/base.py +74 -35
  55. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/core.py +8 -7
  56. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/geoms.py +18 -26
  57. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/paint.py +42 -31
  58. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/positions.py +24 -19
  59. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/stats.py +215 -61
  60. plot_io-0.8.0/plot_io/layout.py +1925 -0
  61. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/legend.py +259 -80
  62. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/limits.py +3 -2
  63. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/mapped.py +17 -7
  64. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/markers.py +4 -10
  65. plot_io-0.8.0/plot_io/markup.py +128 -0
  66. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/plot.py +155 -68
  67. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/__init__.py +8 -7
  68. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/_util.py +62 -21
  69. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/area.py +33 -31
  70. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/bar.py +13 -18
  71. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/box.py +11 -31
  72. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/catpoints.py +1 -1
  73. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/contour.py +17 -18
  74. plot_io-0.8.0/plot_io/presets/dots.py +344 -0
  75. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/ecdf.py +12 -16
  76. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/errorbar.py +5 -5
  77. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/errors.py +9 -9
  78. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/fill.py +3 -3
  79. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/heatmap.py +8 -8
  80. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/hexbin.py +6 -5
  81. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/hist.py +67 -55
  82. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/hist2d.py +5 -5
  83. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/kde.py +46 -36
  84. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/kde2d.py +10 -5
  85. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/line.py +3 -3
  86. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/pie.py +9 -9
  87. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/regression.py +5 -5
  88. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/scatter.py +3 -3
  89. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/stem.py +2 -2
  90. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/violin.py +35 -28
  91. plot_io-0.8.0/plot_io/registry.py +88 -0
  92. plot_io-0.8.0/plot_io/render.py +446 -0
  93. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/rows.py +74 -57
  94. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/settings.py +175 -49
  95. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/sharing.py +28 -16
  96. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/spec.py +5 -3
  97. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/states.py +39 -7
  98. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/styles/__init__.py +66 -37
  99. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/styles/library.py +155 -180
  100. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/text.py +89 -22
  101. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/ticks.py +1 -9
  102. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/times.py +27 -10
  103. plot_io-0.8.0/plot_io/titles.py +188 -0
  104. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/units.py +5 -7
  105. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/values.py +14 -5
  106. {plot_io-0.6.0 → plot_io-0.8.0}/pyproject.toml +5 -2
  107. plot_io-0.8.0/tests/golden.json +191 -0
  108. {plot_io-0.6.0 → plot_io-0.8.0}/tests/helpers.py +8 -6
  109. plot_io-0.8.0/tests/test_api.py +129 -0
  110. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_bars.py +2 -2
  111. plot_io-0.8.0/tests/test_colorbars.py +520 -0
  112. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_decorations.py +8 -8
  113. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_defaults.py +12 -10
  114. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_density.py +40 -29
  115. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_distributions.py +12 -11
  116. plot_io-0.8.0/tests/test_docs.py +70 -0
  117. plot_io-0.8.0/tests/test_dots.py +180 -0
  118. plot_io-0.8.0/tests/test_edge_cases.py +110 -0
  119. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_figure_title.py +12 -1
  120. plot_io-0.8.0/tests/test_fonts.py +134 -0
  121. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_genome.py +71 -59
  122. plot_io-0.8.0/tests/test_genome_fixes.py +231 -0
  123. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_geometry.py +13 -15
  124. plot_io-0.8.0/tests/test_golden.py +384 -0
  125. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_grids.py +10 -8
  126. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_heatmap.py +3 -3
  127. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_jxl_output.py +12 -12
  128. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_layers.py +18 -16
  129. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_layout.py +12 -5
  130. plot_io-0.8.0/tests/test_layout_fixes.py +242 -0
  131. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_maps.py +7 -7
  132. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_markers.py +5 -5
  133. plot_io-0.8.0/tests/test_markup.py +243 -0
  134. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_native.py +60 -6
  135. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_occupancy.py +4 -16
  136. plot_io-0.8.0/tests/test_output.py +263 -0
  137. plot_io-0.8.0/tests/test_output_settings_fixes.py +217 -0
  138. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_palettes.py +5 -5
  139. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_pie.py +1 -1
  140. plot_io-0.8.0/tests/test_plot_fixes.py +312 -0
  141. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_reflines.py +1 -1
  142. plot_io-0.8.0/tests/test_registry.py +56 -0
  143. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_rows.py +44 -6
  144. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_series.py +6 -6
  145. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_settings.py +27 -24
  146. plot_io-0.8.0/tests/test_shared_legends.py +381 -0
  147. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_sharing.py +5 -5
  148. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_simplify.py +24 -11
  149. plot_io-0.8.0/tests/test_size_keys.py +163 -0
  150. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_stats.py +2 -2
  151. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_style_settings.py +11 -11
  152. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_style_types.py +2 -2
  153. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_styles.py +69 -24
  154. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_tables.py +23 -15
  155. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_ticks.py +8 -1
  156. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_time_twin.py +6 -6
  157. plot_io-0.8.0/tests/test_titles.py +625 -0
  158. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_transform.py +3 -3
  159. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_units.py +12 -12
  160. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_values.py +20 -20
  161. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_vocabulary.py +15 -11
  162. {plot_io-0.6.0 → plot_io-0.8.0}/tools/build_native.py +43 -16
  163. {plot_io-0.6.0 → plot_io-0.8.0}/tools/settings_doc.py +23 -10
  164. plot_io-0.6.0/EXAMPLES.md +0 -463
  165. plot_io-0.6.0/plot_io/_backend.py +0 -43
  166. plot_io-0.6.0/plot_io/_native/bin/linux-aarch64.so +0 -0
  167. plot_io-0.6.0/plot_io/_native/bin/linux-x86_64.so +0 -0
  168. plot_io-0.6.0/plot_io/_native/bin/windows-arm64.dll +0 -0
  169. plot_io-0.6.0/plot_io/_native/bin/windows-x86_64.dll +0 -0
  170. plot_io-0.6.0/plot_io/_native/src/data.c +0 -47
  171. plot_io-0.6.0/plot_io/_threads.py +0 -43
  172. plot_io-0.6.0/plot_io/colorbar.py +0 -451
  173. plot_io-0.6.0/plot_io/genome/pack.py +0 -23
  174. plot_io-0.6.0/plot_io/layout.py +0 -1161
  175. plot_io-0.6.0/plot_io/render.py +0 -332
  176. plot_io-0.6.0/plot_io/stats.py +0 -138
  177. plot_io-0.6.0/tests/golden.json +0 -111
  178. plot_io-0.6.0/tests/test_docs.py +0 -19
  179. plot_io-0.6.0/tests/test_fonts.py +0 -66
  180. plot_io-0.6.0/tests/test_golden.py +0 -186
  181. plot_io-0.6.0/tests/test_output.py +0 -153
  182. {plot_io-0.6.0 → plot_io-0.8.0}/LICENSE +0 -0
  183. {plot_io-0.6.0 → plot_io-0.8.0}/examples/box_plots.py +0 -0
  184. {plot_io-0.6.0 → plot_io-0.8.0}/examples/density.py +0 -0
  185. {plot_io-0.6.0 → plot_io-0.8.0}/examples/distributions.py +0 -0
  186. {plot_io-0.6.0 → plot_io-0.8.0}/examples/facets.py +0 -0
  187. {plot_io-0.6.0 → plot_io-0.8.0}/examples/genome_tracks.py +0 -0
  188. {plot_io-0.6.0 → plot_io-0.8.0}/examples/grids2d.py +0 -0
  189. {plot_io-0.6.0 → plot_io-0.8.0}/examples/heatmap.py +0 -0
  190. {plot_io-0.6.0 → plot_io-0.8.0}/examples/large_data.py +0 -0
  191. {plot_io-0.6.0 → plot_io-0.8.0}/examples/layouts.py +0 -0
  192. {plot_io-0.6.0 → plot_io-0.8.0}/examples/line_band.py +0 -0
  193. {plot_io-0.6.0 → plot_io-0.8.0}/examples/scales.py +0 -0
  194. {plot_io-0.6.0 → plot_io-0.8.0}/examples/scatter_groups.py +0 -0
  195. {plot_io-0.6.0 → plot_io-0.8.0}/examples/styles.py +0 -0
  196. {plot_io-0.6.0 → plot_io-0.8.0}/examples/time_twin.py +0 -0
  197. {plot_io-0.6.0 → plot_io-0.8.0}/examples/units.py +0 -0
  198. {plot_io-0.6.0 → plot_io-0.8.0}/examples/variable_fonts.py +0 -0
  199. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/__init__.py +0 -0
  200. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/_native/src/rt.c +0 -0
  201. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/color/__init__.py +0 -0
  202. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/color/data.py +0 -0
  203. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/genome/__init__.py +0 -0
  204. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/genome/layout.py +0 -0
  205. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/genome/scale.py +0 -0
  206. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/context.py +0 -0
  207. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/layers/pipeline.py +0 -0
  208. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/lines.py +0 -0
  209. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/numbers.py +0 -0
  210. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/occupancy.py +0 -0
  211. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/presets/curves.py +0 -0
  212. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/py.typed +0 -0
  213. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/scales.py +0 -0
  214. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/seams.py +0 -0
  215. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/shapes.py +0 -0
  216. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/sizemaps.py +0 -0
  217. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/tables.py +0 -0
  218. {plot_io-0.6.0 → plot_io-0.8.0}/plot_io/transform.py +0 -0
  219. {plot_io-0.6.0 → plot_io-0.8.0}/tests/fonts/PioTest-Bold.ttf +0 -0
  220. {plot_io-0.6.0 → plot_io-0.8.0}/tests/fonts/PioTest-Regular.ttf +0 -0
  221. {plot_io-0.6.0 → plot_io-0.8.0}/tests/fonts/VarTest.ttf +0 -0
  222. {plot_io-0.6.0 → plot_io-0.8.0}/tests/stats_reference.json +0 -0
  223. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_box.py +0 -0
  224. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_entry.py +0 -0
  225. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_limits.py +0 -0
  226. {plot_io-0.6.0 → plot_io-0.8.0}/tests/test_numbers.py +0 -0
@@ -17,22 +17,26 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
17
17
 
18
18
  ## 1. Conventions
19
19
 
20
- * **Model.** A `Figure` holds plots (and colorbars) in a grid; a `Plot` holds series, two
21
- axes, a title, a legend and colorbars; a series holds data and style. Nothing is
22
- computed until the figure is drawn (`save`, `to_bytes`, `draw`), so settings can change
20
+ * **Model.** A `Figure` holds plots (and colorbars) in a grid, and titles; a `Plot` holds
21
+ series, two axes, titles, a legend and colorbars; a series holds data and style. Nothing is
22
+ computed until the figure is drawn (`save`, `write`, `draw`), so settings can change
23
23
  in any order.
24
24
  * **Settings.** Every object takes its settings as keywords when created and in
25
25
  `set(**settings)`, which returns the object. `set(name=None)` goes back to the inherited
26
26
  or default value. `get(name)` returns the value as given (`"4.5pt"`, `"var(color)"`),
27
27
  `resolve(name)` the final one (px, degrees, colors), and `explain(name)` where it comes
28
28
  from ([values](#values)). Unknown names and invalid values raise `ValueError` naming
29
- the setting (with the nearest valid name).
29
+ the setting (with the nearest valid name; `alpha=` names `opacity=`).
30
30
  * **Inheritance.** Settings marked *inherited* in the tables (font, line width, palette,
31
- alpha, `rasterize`, `simplify`) are looked up series → plot → figure → style.
31
+ `opacity`, `rasterize`, `simplify`) are looked up series → plot → figure → style.
32
+ * **Shorthands.** A setting has one full name and at most one shorthand; marker names have
33
+ shorthands too ([shorthands](#shorthands)). Giving a shorthand with its full name is an
34
+ error.
35
+
32
36
  * **Setting groups.** Settings that travel together are declared once as a group and
33
37
  embedded by each owner: `Font` (family, size, variable-font axes), `TextStyle` (size,
34
38
  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
39
+ joins), `Marker`, `FillStyle` (`fill`: on, off or a color; `fill_opacity`) and
36
40
  `NumberFormat`. The naming rule: an owner's primary element takes a group unprefixed, a
37
41
  secondary one prefixed, and every member's prefixed name follows its pattern. A
38
42
  scatter's markers are `size`, `edge_color`, …; a line's are `marker_size`,
@@ -40,9 +44,10 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
40
44
  `whisker_style`; an axis' tick labels are `tick_label_font_size`, `tick_label_weight`,
41
45
  `tick_label_color`. Each table ends with the groups the class embeds and their
42
46
  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, …),
47
+ * **Defaults.** Every default is in one read-only mapping, `pl.DEFAULTS`
48
+ (`plot_io/defaults.py`), the `"default"` style that ends every figure's
49
+ [style chain](#10-styles); styles set other values. Bare names for inherited settings
50
+ (font size, sans-serif, black text, line width, `simplify="auto"`, the palette, …),
46
51
  `"Class.name"` for the settings of each class and `"Group.member"` for every embedding
47
52
  of a group member (`"Marker.size"`: every marker size). A class without an entry uses
48
53
  its base class's, then the group's. Entries are plain data: a default that follows
@@ -52,27 +57,32 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
52
57
  `"calc(1.4 * inherit)"`, a fill's opacity `"calc(0.3 * inherit)"`). `"XAxis.name"` and
53
58
  `"YAxis.name"` give one axis its own default.
54
59
  * **`"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
60
+ from the model (a colorbar's orientation from its side, a legend's inner pad from
56
61
  its frame, a genome track's gap) are resolved with the setting: `resolve()` returns the
57
62
  result and `get()` `"auto"`. Rules that need the data or the layout (axis limits,
58
63
  padding, tick count and rotation, number formats, legend placement) are resolved when
59
64
  the figure is drawn.
60
65
  * **Resolution.** One cascade finds every value, for `resolve`, `get` and `explain`:
61
66
  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.
74
- * **Styles.** `Figure(style=…)` presets settings: a style name or a dict of settings,
75
- merged over the inherited defaults (the bare names of `DEFAULTS`). See [Styles](#styles).
67
+ figure's axis of that role (`fig.x_axis(…)`); for a series' own color or size axis,
68
+ the series' `color_scale`, `color_limits`, … ;
69
+ 2. each style of the figure's chain, nearest first: its key for the object's class,
70
+ then for its base classes (`"Series.opacity"` reaches every series), stopping at a
71
+ class that has a default of its own, then its key for the setting's group
72
+ (`"Marker.size"`). A rule of the class, a default it computes from the model (a
73
+ track's axis lines from its content, the width, spacing, columns and shared x of
74
+ tracks), comes after the keys of its class and of more specific ones
75
+ (`"Track.spines"`, `"Figure.width"`) and before those of its base classes
76
+ (`"Plot.spines"`);
77
+ 3. for inherited settings, the parent's value;
78
+ 4. the class default, then the group default (first, when it refers to the parent's
79
+ value with `inherit`);
80
+ 5. for inherited settings, the bare name: the nearest style's, else `DEFAULTS`'.
81
+
82
+ Within one style, or within `DEFAULTS`, an owner's key comes before its group's:
83
+ `"Line.marker_size"` overrides `"Marker.size"` for lines.
84
+ * **Styles.** `Figure(style=…)` presets settings: a style name or a dict of settings, in
85
+ front of `DEFAULTS`. See [Styles](#10-styles).
76
86
  * **Entry points.** `pl.Figure()`, `pl.Plot()` and the series classes (`pl.Scatter()`, …)
77
87
  each create the levels above them: `pl.Scatter(x, y)` makes a plot (`.plot`) in a new
78
88
  figure (`.plot.figure`). `fig.plot(…)` is `pl.Plot(figure=fig, …)` and `p.scatter(…)` is
@@ -86,8 +96,17 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
86
96
  `Swarm` `width`) are `"80%"` of the slot or `"0.8d"` in data units. Positions along an
87
97
  axis (a decoration's `min`/`max`) take bare numbers as data values. See
88
98
  [values](#values).
89
- Images are `dpi` pixels per inch: `dpi=96` gives one image pixel per px, the default 192
90
- two. A dpi up to 16 is a multiple of 96: `dpi=2` is 192. PDF pages are sized in pt (× 0.75).
99
+ PDF pages are sized in pt (× 0.75).
100
+ * **Resolutions.** A dpi is dots per inch: a number (`150`, `16`), or a multiple of 96
101
+ written `"2x"` (192 dpi), wherever a resolution is taken (`dpi`, `default_dpi`,
102
+ `rasterize`, `simplify`, `flatten`'s `dpi`). Images are `dpi` pixels per inch (the
103
+ figure's `default_dpi`, `"4x"`, when an output gives none): `96` gives one image pixel per
104
+ px, `"4x"` four.
105
+ * **Opacity and alpha.** `opacity` (and `fill_opacity`, `band_opacity`, `frame_opacity`,
106
+ `glyph_opacity`, `opacity_range`) multiplies what is drawn; alpha is the alpha channel of
107
+ a color (`"#rrggbbaa"`, `"rgb(… / 0.5)"`), kept and multiplied by the opacity. `fill` is
108
+ `True` (the owner's color), a color or `False`; its opacity is `fill_opacity`, for a
109
+ color too, as in SVG (`fill="red", fill_opacity=1` for an opaque red fill).
91
110
  * **Data.** Sequences (`None` = missing), `array.array`, or any buffer (numpy arrays are
92
111
  read without importing numpy). NaN or `None` values are missing: scatter skips them,
93
112
  line and fill break there, box ignores them, heatmap cells take `nan_color`.
@@ -95,7 +114,15 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
95
114
  ([tables](#tables-data)); dates make time axes ([dates](#dates-and-times)).
96
115
  * **Text.** Titles, axis labels and legend entries are strings or rich content: a list of
97
116
  strings and `pl.Span` (vec_io's), e.g. `["Area (m", pl.Span("2",
98
- baseline_shift="super", font_scale=0.7), ")"]`.
117
+ baseline_shift="super", font_scale=0.7), ")"]`. Strings take markup:
118
+ `"Growth of <i>E. coli</i> at <b>37 °C</b>"`, `"Area (m<sup>2</sup>)"`. Tags: `<i>`/`<em>`
119
+ italic, `<b>`/`<strong>` bold, `<u>` underline, `<s>`/`<del>` strikethrough, `<sup>` and
120
+ `<sub>` (0.7 of the size, raised 0.33 em or lowered 0.2 em), in either case, nested,
121
+ each closed by its own end tag; an unclosed or crossed tag is an error. Styles add to the text's own (`<b>`
122
+ in a bold title stays bold). Any other `<` is text (`x < 5`, `<0.05`); `&lt;`, `&gt;` and
123
+ `&amp;` write `<`, `>` and `&`. Strings inside rich content are read too; tick labels
124
+ take no markup. `markup=False` (inherited: on the figure, a plot or a text element) keeps
125
+ strings literal; `get()` returns the string as given.
99
126
  * **Named colors.** `"blue"`, `"blue 0.45"`, `"blue 45%"`: 28 scales (`red`, `orange`,
100
127
  `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`,
101
128
  `violet`, `purple`, `fuchsia`, `pink`, `rose`, `slate`, `gray`/`grey`, `zinc`, `neutral`,
@@ -120,20 +147,55 @@ Complete reference. Worked examples are in [EXAMPLES.md](EXAMPLES.md).
120
147
  `pl.Figure(font_family="Roboto Flex", font_stretch="85%", font_variations={"GRAD": 50})`.
121
148
  * **Text and fonts.** Text is shaped by `vec_io.text` (pairs kerned) and its fonts are
122
149
  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
150
+ the first family of `font_family` that is available (the `fonts` setting or output
151
+ option, a vec_io `Fonts`: its `dirs`, then `VEC_IO_FONT_DIRS`, then installed fonts unless
152
+ `system=False`; a family that is
125
153
  not installed tries its metric aliases first: Helvetica and Arial → Liberation Sans,
126
154
  Arimo, …), then a generic family's list (`sans-serif`: Arial, Helvetica, Liberation
127
155
  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).
156
+ `"Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo"` is Helvetica where
157
+ installed, else the first of the others installed (all have Helvetica's widths); with
158
+ none installed, vec_io downloads Nimbus Sans (URW's base 35 fonts). With no outline
159
+ font at all, output raises
160
+ `NoFontError` (a `ValueError`, from vec_io). A line of text is `line_height` tall (a
161
+ multiple of the font size; default 1), the glyphs centered in it, so the gaps around
162
+ text do not change with the font; `"normal"` takes the font's ascent and descent.
131
163
  * **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.
164
+ (`ColorAxis`, `SizeAxis`, `ColorMap`, `SizeMap`, `Palette`, `Density`, `Errors`,
165
+ `Span`), `facet`, `registry` (below), `Series`, `set_style`, `use_style` and `DEFAULTS`;
166
+ see [modules](#12-modules) for the rest. Enum-like settings take strings.
167
+ * **Registries.** `pl.registry` groups the named things: `registry.color_maps`,
168
+ `palettes`, `markers`, `styles` and `layers` (plot types), each with `add(name, value)`,
169
+ `names()` and `get(name)` (`ValueError` for an unknown name) and `name in registry.…`.
170
+ * **Guides.** Titles, legends and colorbars follow one pattern. A figure has
171
+ `fig.add_title`, `fig.add_legend` and `fig.add_colorbar` (in the lanes beside a set of
172
+ plots, `side=`) and `fig.colorbar_area` (a colorbar in its own grid area); a plot has
173
+ `p.add_title`, `p.add_legend` (the plot's legend, `p.legend`) and `p.add_colorbar`
174
+ (attached, `side=`); `fig.plot(legend=…, colorbar=…)` calls them for the common case.
175
+
176
+ ### Shorthands
177
+
178
+ `settings.ALIASES` (setting names, on every class with the full setting) and
179
+ `settings.MARKER_ALIASES` (marker names):
180
+
181
+ <!-- settings:shorthands -->
182
+ | Shorthand | Stands for |
183
+ |---|---|
184
+ | `c=` | `color=` |
185
+ | `s=` | `size=` |
186
+ | `cmap=` | `color_map=` |
187
+ | `smap=` | `size_map=` |
188
+ | `marker="o"` | `"circle"` |
189
+ | `marker="s"` | `"square"` |
190
+ | `marker="d"` | `"diamond"` |
191
+ | `marker="^"` | `"triangle_up"` |
192
+ | `marker="v"` | `"triangle_down"` |
193
+ | `marker="<"` | `"triangle_left"` |
194
+ | `marker=">"` | `"triangle_right"` |
195
+ | `marker="+"` | `"plus"` |
196
+ | `marker="x"` | `"cross"` |
197
+ | `marker="triangle"` | `"triangle_up"` |
198
+ <!-- /settings -->
137
199
 
138
200
  ### Values
139
201
 
@@ -147,7 +209,7 @@ p.bar(days, counts, width="20h") # a duration on a time axis
147
209
  p.box(groups, positions=[1, 4, 9], width="0.8d") # data units (default: 80% of the slot)
148
210
  p.errorbar(x, y, y_error=e, cap_length="0.2d") # data units across the bar
149
211
  p.title(font_size="large", color="var(--accent)")
150
- p.legend(pad="calc(1em - 2px)")
212
+ p.add_legend(pad="calc(1em - 2px)")
151
213
  fig.set(vars={"accent": "#c00"}) # custom variables, read by var(--name)
152
214
  ```
153
215
 
@@ -166,7 +228,7 @@ fig.set(vars={"accent": "#c00"}) # custom variables, read by v
166
228
 
167
229
  * **`var(name[, fallback])`** reads another setting of the object, resolved through the
168
230
  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
231
+ parent's value of the same setting (`opacity="calc(inherit / 2)"`). `var(--name)` reads a custom variable: from the
170
232
  nearest `vars` (figure or plot), else a `"--name"` key of the style. The fallback is used
171
233
  when the value is unset. Loops raise. Text settings (titles, labels, names, formats)
172
234
  never read `var()`.
@@ -201,7 +263,8 @@ What `%` of a length can be of, besides another setting (the tables name it per
201
263
  | `axes_length` | the axes length along the axis |
202
264
  | `data_range` | the axis range |
203
265
  | `bar_across` | the axes side across the colorbar |
204
- | `bar_along` | the axes side along the colorbar |
266
+ | `bar_thickness` | the span along a key, the axes side across a bar |
267
+ | `bar_along` | the span along the colorbar (the axes side of an attached one) |
205
268
  | `figure` | the figure width (across) or height (down) |
206
269
  | `slot` | the slot: one category, or the smallest gap between positions |
207
270
  | `slot_part` | each series' part of a shared slot |
@@ -212,8 +275,9 @@ What `%` of a length can be of, besides another setting (the tables name it per
212
275
  #### Setting groups
213
276
 
214
277
  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.
278
+ `"FillStyle.fill_opacity"` sets the opacity of every series fill (bars, boxes, violins,
279
+ pies, densities, contours, genome signals and intervals); `"Marker.fill"` turns every
280
+ marker fill on or off.
217
281
 
218
282
  <!-- settings:groups -->
219
283
  | Group | Member | Under a prefix `{p}` | Default |
@@ -223,12 +287,14 @@ contours, genome signals and intervals); `"Marker.fill"` every marker fill.
223
287
  | `Font` | `font_stretch` | `{p}font_stretch` | inherited |
224
288
  | `Font` | `font_variations` | `{p}font_variations` | inherited |
225
289
  | `Font` | `font_optical_sizing` | `{p}font_optical_sizing` | inherited |
290
+ | `Font` | `line_height` | `{p}line_height` | inherited |
291
+ | `Font` | `markup` | `{p}markup` | inherited |
226
292
  | `TextStyle` | `font_size` | `{p}font_size` | '1em' |
227
293
  | `TextStyle` | `font_weight` | `{p}weight` | 'normal' |
228
294
  | `TextStyle` | `font_style` | `{p}style` | 'normal' |
229
295
  | `TextStyle` | `color` | `{p}color` | 'var(text_color)' |
230
296
  | `Stroke` | `color` | `{p}color` | — |
231
- | `Stroke` | `line_width` | `{p}width` | 0.75 |
297
+ | `Stroke` | `line_width` | `{p}width` | 0.5 |
232
298
  | `Stroke` | `line_style` | `{p}style` | 'solid' |
233
299
  | `Stroke` | `cap` | `{p}cap` | 'butt' |
234
300
  | `Stroke` | `join` | `{p}join` | 'round' |
@@ -236,10 +302,12 @@ contours, genome signals and intervals); `"Marker.fill"` every marker fill.
236
302
  | `Marker` | `size` | `{p}size` | 4.5 |
237
303
  | `Marker` | `color` | `{p}color` | — |
238
304
  | `Marker` | `edge_color` | `{p}edge_color` | 'auto' |
239
- | `Marker` | `edge_width` | `{p}edge_width` | 0.75 |
305
+ | `Marker` | `edge_width` | `{p}edge_width` | 0.5 |
240
306
  | `Marker` | `fill` | `{p}fill` | True |
307
+ | `Marker` | `fill_opacity` | `{p}fill_opacity` | 1.0 |
241
308
  | `Marker` | `size_basis` | `size_basis (never prefixed)` | 'area' |
242
309
  | `FillStyle` | `fill` | `{p}fill` | — |
310
+ | `FillStyle` | `fill_opacity` | `{p}fill_opacity` | — |
243
311
  | `NumberFormat` | `decimal_separator` | `{p}decimal_separator` | inherited |
244
312
  | `NumberFormat` | `thousands_separator` | `{p}thousands_separator` | inherited |
245
313
  | `NumberFormat` | `minus` | `{p}minus` | inherited |
@@ -262,8 +330,11 @@ pl.Figure(**settings)
262
330
  fig.plot(id=None, **settings) # the plot with id (created if needed), or the next one
263
331
  fig.scatter(x, y, **settings) # any plot type: a new plot holding it
264
332
  fig.title(text, **settings) # figure title
333
+ fig.add_title(text, plots=None, side="top", **settings) # another, over plots
334
+ fig.add_legend(plots=None, side="right", **settings) # a legend of plots' entries
265
335
  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
336
+ fig.add_colorbar(source=None, plots=None, side="bottom", **settings) # beside plots
337
+ fig.colorbar_area(source, id=None, **settings) # a color axis' guide in its own area
267
338
  fig.color_axis(**settings) # a shared color axis (fig.size_axis: size)
268
339
  fig.size_legend(source, id=None, values=None, title=None)
269
340
  fig.track(**settings) # a new track (layout="tracks")
@@ -271,6 +342,7 @@ fig.vline(x, rows=None, **settings) # through plots and the gaps between th
271
342
  fig.vspan(x0, x1=None, rows=None, **settings)
272
343
  fig.group(first, last=None, label=None, letter=None)
273
344
  fig.plots # plots in creation order
345
+ fig.titles, fig.legends, fig.colorbars # figure titles (main first), legends, colorbars
274
346
  ```
275
347
 
276
348
  A plot type called on the figure (`fig.scatter(…)`, `fig.hist(…)`, `fig.bigwig(…)`) makes
@@ -326,30 +398,36 @@ are names; `fig.plot()` gives 1, 2, 3, … skipping taken ids.
326
398
  | `"axes"` | each cell's axes are `width` | the widest plot box of a column (axes plus the column's largest margins) is `width`; the axes are what is left | the figure is `width`; the axes share what the gutters leave |
327
399
  | `"borders"` | a column's box is `width` plus the largest margins in it, so every axes rectangle is at least `width` | each cell's box is `width` | the figure is `width`; the boxes share what the gaps leave |
328
400
 
329
- * Columns (rows) holding only vertical (horizontal) colorbars are as wide as the bar,
330
- unless `widths` (`heights`) is given.
401
+ * Columns (rows) holding only vertical (horizontal) colorbars are as wide as the bar (a
402
+ key: as wide as it is), unless `widths` (`heights`) is given.
331
403
  * Margins come from the real text metrics of tick labels, axis labels, titles, outside
332
404
  legends and attached colorbars ([layout](#layout)).
333
405
 
334
406
  ### Layout
335
407
 
336
408
  * **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.
409
+ axes outward: tick marks, tick labels, the axis label, twin axes, the y axis' ×10ᵏ
410
+ offset (on top, past the x axis and twin x axes there), an outside legend, attached
411
+ colorbars, the plot's titles and (on top) the plot's `space_above`; outermost on the
412
+ left, the row label band and the band of [group](#rows) letters, as wide as the widest
413
+ of the plot's grid column. Each band has a thickness and an overhang along its side
414
+ (tick labels past the ends of the axis, a wide title or axis label). A side's margin is
415
+ its bands' thicknesses, at least the overhangs of the bands across it. Bands stack:
416
+ each starts past the ones before it (mirrored ticks included), the titles past
417
+ everything on their side; only twin axes are drawn at the axes edge. An axis label
418
+ (a string) longer than the plot's box along its axis (the axes and the other axis'
419
+ ticks and tick labels) wraps at spaces to that length.
345
420
  * **Grid.** Each line between cells takes the largest margin of the plots there
346
421
  (`align="axes"`), or each plot's axes are what its margins leave of its box
347
422
  (`"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.
423
+ figure title is a band at the top of the figure, and the other figure titles, the
424
+ figure legends and colorbars and the groups' labels sit in lanes in the lines between
425
+ cells ([figure title](#figure-title)).
349
426
  * **Rounds.** Only what is circular is repeated: an axis' length sets its ticks, whose
350
427
  labels set the margins, which (with `reference="plot"` or `"figure"`) set the length;
351
428
  `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
429
+ [bins](#9-genome-tracks)); the figure title's band in a figure of fixed height; the
430
+ lanes of figure titles that wrap to the width of the plots they cover. A round
353
431
  measures every plot for its axes size and solves the grid. Rounds stop when no axes size
354
432
  moves by more than 1/3 px; after 5, a layout still moving (between two tick sets) keeps
355
433
  the last. With `reference="axes"` one round suffices. `position="auto"` legends are
@@ -357,10 +435,13 @@ are names; `fig.plot()` gives 1, 2, 3, … skipping taken ids.
357
435
  * **Geometry.** The layout ends in a frozen geometry: every axes rectangle, tick mark,
358
436
  text run, legend entry and colorbar in px. Drawing reads it and measures nothing: a text
359
437
  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.
438
+ database), which is what is drawn; figure titles on top and bottom are laid out once as
439
+ paragraphs.
361
440
  * **One plot.** `p.save()` lays out the whole figure and keeps the plot at its size in it:
362
441
  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.
442
+ leave), with its outer tick labels, its own row label band, its own titles and its
443
+ whole legend and its attached colorbars (figure titles, legends and colorbars are left
444
+ out).
364
445
 
365
446
  ### Figure title
366
447
 
@@ -368,32 +449,84 @@ are names; `fig.plot()` gives 1, 2, 3, … skipping taken ids.
368
449
  fig.title(text, **settings) # None removes it
369
450
  ```
370
451
 
371
- A band at the top of the figure: the title's height (all lines, wrapped within its
372
- width) plus `pad`. The figure grows by the band, except with `reference="figure"`, where
373
- the plots shrink by it. `over="axes"` aligns it within the leftmost to
374
- rightmost axes (a left-aligned title starts at the first y axis line), `"figure"` within
375
- the figure minus `margin`. Rich content styles a second line (`["Title\n",
376
- pl.Span("subtitle", font_size=7, font_weight="normal")]`). It is drawn last and is not
377
- part of `Plot.save`. `title=` given to `pl.Plot` sets the plot title. The figure's
378
- `title_rule_color` draws a rule `title_rule_width` thick above the title, across its
379
- width.
452
+ ```python
453
+ fig.add_title("Treated", plots=[a, b], side="top", **settings) # returns it
454
+ fig.titles # the main title first
455
+ ```
456
+
457
+ The main title is a band at the top of the figure: the title's height (all lines,
458
+ wrapped within its width) plus `pad`. The figure grows by the band, except with
459
+ `reference="figure"`, where the plots shrink by it. `over="axes"` aligns it within the
460
+ leftmost to rightmost axes (a start-aligned title starts at the first y axis line),
461
+ `"plot"` within their boxes, `"figure"` within the figure minus `margin`. Rich content
462
+ styles a second line (`["Title\n", pl.Span("subtitle", font_size=7,
463
+ font_weight="normal")]`). It is drawn last and is not part of `Plot.save`. `title=` given
464
+ to `pl.Plot` sets the plot title. `rule` draws a line `rule_width` thick across its width:
465
+ `"outside"` above the title (The Economist's red bar, in the `economist` style), `True`
466
+ between the title and the plots.
467
+
468
+ `fig.add_title` makes a title over a set of plots (plots or their series, as
469
+ `fig.group` takes them; default every plot), which covers the grid rectangle of their
470
+ cells: a plot inside that rectangle but not given is an error naming it. Figure titles
471
+ share the settings of plot titles ([title](#title)).
472
+
473
+ ```python
474
+ fig.add_title("Sites", plots=[a, b, c])
475
+ fig.add_title("Treated", plots=[a, b]) # nested: under "Sites"
476
+ fig.add_title("Control", plots=[d, e], rule=True) # beside another span: same lane
477
+ fig.add_title("Batch 1", plots=[a, d], side="left")
478
+ ```
479
+
480
+ * **Lanes.** A figure title sits in the line between cells beside the plots it covers: a
481
+ top title above its topmost row, a bottom one below its bottommost, a left or right one
482
+ beside its first or last column. The titles of one side of a line stack outward from
483
+ the plots: a title whose plots are a subset of another's is nearer, titles over
484
+ disjoint spans share a lane, overlapping ones take lanes in creation order; `order`
485
+ overrides (lower nearer; unset counts as the lane the rules give): a title sits past
486
+ every lane of a lower order, and titles of one order share a lane where their spans
487
+ are disjoint. A lane is as thick
488
+ as its thickest title: `pad`, the text, and `rule_width + rule_gap` with a rule. Plot
489
+ titles are inside the plots' boxes, nearer than any figure title. Figure legends and
490
+ colorbars take lanes too ([figure legends](#figure-legends), [colorbars](#colorbars));
491
+ over the same plots, from the plots outward: legend, colorbar, title.
492
+ * **Gaps.** The gap at a line between rows (columns) is `spacing` plus its lanes, along
493
+ the whole line, so the titles in it line up. On the figure's edge, the lanes come between
494
+ two `margin`s, one at the edge and one between them and the plots, as the main title's
495
+ band does. With `reference="figure"` the plots shrink by the lanes; otherwise the
496
+ figure grows.
497
+ * **Text.** Titles on top and bottom wrap to their span (`over`); titles on the left and
498
+ right do not (`\n` starts a line) and read upward on the left, downward on the right.
499
+ * A [group](#rows)'s `label` is a left figure title over its plots.
500
+ * The main title is the outermost lane of the top, over every plot. On another side,
501
+ rotated, or with an `order`, it is laid out in the lanes as the others are.
502
+ Style keys `"MainTitle.name"` apply to it alone, `"FigureTitle.name"` to every figure
503
+ title.
504
+ * `p.save()` (one plot alone) leaves out the figure titles, legends and colorbars.
380
505
 
381
506
  <!-- settings:FigureTitle -->
382
507
  | Setting | Default | Meaning |
383
508
  |---|---|---|
384
509
  | `text` | — | Title text: a string or rich content; `\n` starts a line. |
510
+ | `side` | 'top' | `top`, `bottom`, `left` or `right`. |
511
+ | `align` | 'center' | Alignment along the side: `start`, `center`, `end`, or an end by name: `left`, `right` on top and bottom, `top`, `bottom` on the left and right; there `start` is where rotated text begins (the bottom at 90, the top at −90 and 0). |
512
+ | `over` | 'axes' | Span it is aligned and wrapped within: from the first to the last axes of its plots, their boxes, or the whole figure. |
513
+ | `rotation` | 'auto' | `auto`: 0 on top and bottom, 90 on the left (reads upward), −90 on the right (reads downward); or 0, 90, −90. |
514
+ | `pad` | '0.5em' | Gap between the title and the plots. Length. |
515
+ | `order` | — | Place in its side's lanes: lower is nearer the plots; unset: a title nested in another nearer, then creation order. |
516
+ | `rule` | False | A line along the span: `True` or `"inside"` between the title and what it covers, `"outside"` beyond the title, `False` none. |
517
+ | `rule_color` | 'var(color)' | Color of the rule. |
518
+ | `rule_width` | 'var(line_width)' | Thickness of the rule. Length. |
519
+ | `rule_gap` | '0.5em' | Gap between the rule and the title. Length; `%`: of the font size. |
385
520
  | `font_size` | '1em' | Font size; default the base font size. Length; `%`: of the parent's font size. |
386
521
  | `font_weight` | 'bold' | `normal`, `bold` or a weight 1–1000. |
387
522
  | `font_style` | 'normal' | `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
388
- | `align` | 'center' | Alignment. |
389
- | `over` | 'axes' | Width it is aligned and wrapped within: from the leftmost to the rightmost axes, or the whole figure. |
390
- | `pad` | '0.5em' | Gap between the title and the plots; default half the font size. Length. |
391
523
  | `color` | 'var(text_color)' | Text color. |
392
- | `rule_gap` | '0.5em' | Gap between the title and the figure's `title_rule_color`. Length; `%`: of the font size. |
393
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
524
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
394
525
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
395
526
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
396
527
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
528
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
529
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
397
530
 
398
531
  Groups: `TextStyle`, `Font`.
399
532
  <!-- /settings -->
@@ -411,7 +544,8 @@ the same column span) or `"row"` (the same row span). `share` sets both; `"grid"
411
544
  per column and y per row. A plot's own `share_x`, `share_y` or `share` (another plot)
412
545
  overrides the figure's groups for it; groups chain. Colorbars and plots without axes are
413
546
  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)).
547
+ series' color and size axes ([color and size axes](#6-color-and-size-axes)), and
548
+ `share_legend` for one legend of their entries ([figure legends](#figure-legends)).
415
549
 
416
550
  Within a group the scale (which must be equal), the limits (from all members' series,
417
551
  then padding, `include_zero` and `snap`; one explicit `limits` applies to the group, two
@@ -451,9 +585,15 @@ fig.vspan(-1, 1) # under every plot
451
585
  label: beside its axis or in the band. Tracks put theirs in the band. A plot's
452
586
  `space_above` adds space above it.
453
587
  * **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).
588
+ or their series, in creation order). Its `label` is a left [figure title](#figure-title)
589
+ over them, reading upward, centered on their axes, in the group's font settings
590
+ (`font_size`, `font_family`, `text_color`, `markup`; normal weight) and `pad` from the
591
+ plots; it is made at each layout, in the group's creation order, and is not in
592
+ `fig.titles`. The plots must fill the grid rectangle they span. A bold panel `letter`
593
+ sits in a band left of the row labels, level with the top of the first plot's axes.
594
+ With a shared x axis and `label_outer`, the group's last plot shows the tick labels too
595
+ (the axis title stays under the bottom plot). `p.save()` leaves out the label, as other
596
+ figure titles.
457
597
  * **Lines and bands.** `fig.vline(x, rows=None)` and `fig.vspan(x0, x1, rows=None)` run
458
598
  from the top of the first of the plots `rows` (a plot, a series, or a list; all by
459
599
  default) to the bottom of the last one, gaps included, in each grid column; `x` is in
@@ -467,9 +607,9 @@ FigureVLine:
467
607
  | Setting | Default | Meaning |
468
608
  |---|---|---|
469
609
  | `color` | '#4d4d4d' | Line color. |
470
- | `line_width` | inherited (0.75) | Line width. Length. |
610
+ | `line_width` | inherited (0.5) | Line width. Length. |
471
611
  | `line_style` | 'dashed' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list. Length. |
472
- | `alpha` | 1.0 | Opacity. |
612
+ | `opacity` | 1.0 | Opacity. |
473
613
 
474
614
  Groups: `Stroke`.
475
615
  <!-- /settings -->
@@ -480,7 +620,7 @@ FigureVSpan:
480
620
  | Setting | Default | Meaning |
481
621
  |---|---|---|
482
622
  | `color` | '#e5e5e5' | Fill color. |
483
- | `alpha` | 1.0 | Opacity. |
623
+ | `opacity` | 1.0 | Opacity. |
484
624
  <!-- /settings -->
485
625
 
486
626
  FigureGroup:
@@ -488,16 +628,17 @@ FigureGroup:
488
628
  <!-- settings:FigureGroup -->
489
629
  | Setting | Default | Meaning |
490
630
  |---|---|---|
491
- | `label` | — | Group label, rotated, left of the plots' row labels. |
492
- | `letter` | — | Panel letter at the group's top left. |
631
+ | `label` | — | Group label: a left figure title over the group's plots, reading upward, centered on their axes. |
632
+ | `letter` | — | Panel letter at the group's top left, left of the row labels. |
493
633
  | `font_size` | '1em' | Font size of the label. Length; `%`: of the parent's font size. |
494
634
  | `letter_font_size` | '1.4em' | Font size of the letter. Length; `%`: of the font size. |
495
635
  | `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. |
636
+ | `pad` | '0.5em' | Gap right of the letter, and the label's `pad` (its gap to the plots). Length; `%`: of the font size. |
637
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
498
638
  | `text_color` | inherited ('black') | Text color. |
639
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
499
640
 
500
- Groups: `TextStyle` (`letter_`).
641
+ Groups: `TextStyle` (`letter_`), `Font`.
501
642
  <!-- /settings -->
502
643
 
503
644
  ### Facets
@@ -526,10 +667,12 @@ panels. `wrap` wraps `col` alone into rows of that many panels. Panels are title
526
667
  column, y per row, outer labels only), `share_color` (default `"all"`: the panels'
527
668
  color axes train as one; a `color_map`, `color_limits` or `color_scale` given to the
528
669
  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.
670
+ one size key) and `share_legend` (default `"all"`: one legend for the panels' entries,
671
+ on the right, [figure legends](#figure-legends)).
672
+ * **Colorbar.** `colorbar="right"`, `"left"`, `"top"` or `"bottom"` adds the colorbar of
673
+ the first call that maps colors (`panels.colorbar`, a
674
+ [figure colorbar](#colorbars) over every panel, `fig.add_colorbar`) on that side: the
675
+ guide of the panels' shared color axis.
533
676
  * `panels.panels` maps facet keys (a value, or `(row value, col value)`) to plots;
534
677
  `panels.plot(key)` returns one; iterating the set gives the plots; `panels.subsets()`
535
678
  gives `(key, plot, rows)`.
@@ -546,35 +689,37 @@ panels. `wrap` wraps `col` alone into rows of that many panels. Panels are title
546
689
  | `align` | 'axes' | `axes`: axis lines line up across plots; `borders`: plot boxes line up. |
547
690
  | `widths` | — | Column widths: ratios (numbers or `fr`) sharing the room left by fixed lengths (`"2in"`, `"30%"` of the figure width). |
548
691
  | `heights` | — | Row heights, as `widths`. |
549
- | `width` | '150px' | Width of the `reference` box: one cell's axes, one cell's plot, or the figure. Length. |
550
- | `height` | 'calc(var(width) / var(aspect_ratio))' | Height of the `reference` box. Length. |
692
+ | `width` | '150px' | Width of the `reference` box: one cell's axes, one cell's plot, or the figure; a paper size names its width (`"a4"`, `"letter"`, `"a4-landscape"`). Length. |
693
+ | `height` | 'calc(var(width) / var(aspect_ratio))' | Height of the `reference` box (a paper size: its height). Length. |
551
694
  | `aspect_ratio` | 1.25 | Width / height of the `reference` box (16:9 → `16 / 9`), when only one of `width` and `height` is given. |
552
695
  | `reference` | 'axes' | What `width` and `height` measure: `axes` (each grid cell's axes rectangle), `plot` (each cell's whole plot box) or `figure`. |
553
696
  | `spacing` | 13.0 | Minimum gap between neighbouring plots. Length; `%`: of the figure width (across) or height (down). |
554
697
  | `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). |
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). |
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. |
559
- | `title_rule_width` | 4.0 | Thickness of the title rule. Length. |
698
+ | `background` | 'white' | Figure background, default the style's (white); `"none"` or `"transparent"`: transparent (white in JPEG, which has no transparency). `None` unsets it. |
699
+ | `fonts` | — | Where fonts come from: a vec_io `Fonts` or a dict of its fields (`dirs`, `system`, `downloads`: `True`, `False` or `"cache"`, `db`); unset: `VEC_IO_FONT_DIRS`, installed fonts and `VEC_IO_FONT_DOWNLOADS` (downloads on by default). |
700
+ | `default_dpi` | '4x' | Resolution of PNG, JPEG, JPEG XL and AVIF output when `save`/`write` give no `dpi`: dots per inch, or a multiple of 96 (`"2x"` is 192); `96` gives one image pixel per px, the default `"4x"` four. PDF, EPS and SVG output never use it. |
701
+ | `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 PDF and SVG output (stored as JPEG); `"lossless"` (not JPEG); `"auto"`: 90 for PNG and JPEG, lossless for JPEG XL, AVIF and PDF content. |
560
702
  | `share_x` | — | Plots sharing their x axis: `False`, `True`/`"all"`, `"col"` (same column span) or `"row"` (same row span). |
561
703
  | `share_y` | — | Plots sharing their y axis, as `share_x`. |
562
704
  | `share` | — | Both axes at once: as `share_x`, or `"grid"` (x per column, y per row); `share_x`/`share_y` override it. |
563
705
  | `share_color` | False | Plots whose series' own color axes are one (limits over all their values), as `share_x`. |
564
706
  | `share_size` | False | Plots whose series' own size axes are one (limits over all their values, one size key), as `share_x`. |
707
+ | `share_legend` | False | Legends shared by plots, made by the figure: `False`, `True`/`"all"` (one on the right of the figure), `"row"` (one on the right of each row), `"col"` (one at the bottom of each column). |
565
708
  | `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`. |
566
709
  | `style` | — | A style name (`"ggplot2"`, …) or a dict of settings with an optional `"base"`; default: the session style (`set_style`, `use_style`), else `"default"`. |
567
710
  | `vars` | — | Custom variables, read by `var(--name)` in any setting here and below: `{"accent": "#c00"}`. |
568
711
  | `scaling` | 1.0 | Multiplies every font size, line width, marker size, tick length and pad of the style; default 1. |
569
712
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
570
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
713
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
571
714
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
572
715
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
573
716
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
717
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
718
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
574
719
  | `text_color` | inherited ('black') | Text color. |
575
- | `line_width` | inherited (0.75) | Default line width. Length. |
720
+ | `line_width` | inherited (0.5) | Default line width. Length. |
576
721
  | `palette` | inherited ('tab10_custom') | Colors of series without one. |
577
- | `alpha` | inherited (1.0) | Default opacity of series. |
722
+ | `opacity` | inherited (1.0) | Default opacity of series. |
578
723
  | `rasterize` | inherited (False) | `True` or a dpi: series drawn as images inside the PDF. |
579
724
  | `simplify` | inherited ('auto') | vec_io's `simplify` for every series; default `"auto"`. |
580
725
  | `data` | inherited (None) | A table whose columns the series' data arguments name. |
@@ -586,22 +731,27 @@ panels. `wrap` wraps `col` alone into rows of that many panels. Panels are title
586
731
  | `suffix` | inherited ('') | Text after every number. |
587
732
  | `precision` | inherited (None) | Significant digits of `auto`, `sci`, `eng`, `si` (unset: as needed). |
588
733
 
589
- Groups: `Stroke` (`title_rule_`), `Font`, `NumberFormat`.
734
+ Groups: `Font`, `NumberFormat`.
590
735
  <!-- /settings -->
591
736
 
592
737
  ## 3. Plots
593
738
 
594
739
  ```python
595
- pl.Plot(figure=None, id=None, **settings) # title="…", x_axis={…}, y_axis={…}
740
+ pl.Plot(figure=None, id=None, **settings) # title=, x_axis={…}, y_axis={…}, legend=, colorbar=
596
741
  p.scatter(x, y, **s) p.line(x, y=None, **s) p.fill(x, y1, y2=0, **s)
597
- p.box(values, **s) p.heatmap(values, **s) p.colorbar(source=None, **s)
598
- p.title(text, **s) p.x_axis(label, **s) p.y_axis(label, **s) p.legend(position, **s)
599
- p.series p.colorbars p.figure p.id
742
+ p.box(values, **s) p.heatmap(values, **s) p.dots(color, size=None, **s)
743
+ p.title(text, **s) p.x_axis(label, **s) p.y_axis(label, **s)
744
+ p.add_title(text, side="top", **s) # another title, returned
745
+ p.add_legend(position=None, **s) # the plot's legend (p.legend), returned
746
+ p.add_colorbar(source=None, side=None, **s) # an attached colorbar, returned
747
+ p.series p.titles p.colorbars p.figure p.id
600
748
  ```
601
749
 
602
- `p.title`, `p.x_axis`, `p.y_axis` and `p.legend` are objects; calling one sets its
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":
750
+ `p.title`, `p.x_axis` and `p.y_axis` are objects; calling one sets its settings and
751
+ returns it (`p.legend` is set by `p.add_legend`, or `p.legend.set`). At creation (and in
752
+ `p.set`), `title=` sets the title text, `x_axis={…}`, `y_axis={…}` set the axes' settings,
753
+ `legend=` (a position, a dict of legend settings or `False`) calls `add_legend` and
754
+ `colorbar=` (`True`, a side or a dict of colorbar settings) `add_colorbar`: `pl.Scatter(x, y, x_axis={"scale":
605
755
  "log"})`, `fig.bigwig(reader, y_axis={"label": "ATAC"})`. Series are drawn in `z` order (default: call order) inside the
606
756
  axes clip.
607
757
 
@@ -612,7 +762,7 @@ axes clip.
612
762
  | `data_ratio` | — | Data aspect ratio: 1 makes one unit as long on both axes. |
613
763
  | `background` | — | Background color of the axes area. |
614
764
  | `border_color` | — | Color of a frame around the axes area (drawn under the axis lines); default none. |
615
- | `border_width` | 0.75 | Width of the frame. Length. |
765
+ | `border_width` | 0.5 | Width of the frame. Length. |
616
766
  | `clip` | True | Clip series to the axes area. |
617
767
  | `axes` | True | Draw axes; `False` hides both axes, drops padding and fixes the aspect to 1 (set by pie charts). |
618
768
  | `share_x` | — | Another plot of the figure whose x axis this plot shares (groups chain); overrides the figure's `share_x`. |
@@ -621,14 +771,16 @@ axes clip.
621
771
  | `share` | — | Another plot whose x and y axes this plot shares. |
622
772
  | `space_above` | 0.0 | Space above the plot, beyond the figure's `spacing`. Length; `%`: of the font size. |
623
773
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
624
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
774
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
625
775
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
626
776
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
627
777
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
778
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
779
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
628
780
  | `text_color` | inherited ('black') | Text color. |
629
- | `line_width` | inherited (0.75) | Default line width. Length. |
781
+ | `line_width` | inherited (0.5) | Default line width. Length. |
630
782
  | `palette` | inherited ('tab10_custom') | Colors of series without one. |
631
- | `alpha` | inherited (1.0) | Default opacity of series. |
783
+ | `opacity` | inherited (1.0) | Default opacity of series. |
632
784
  | `rasterize` | inherited (False) | `True` or a dpi: series drawn as images inside the PDF. |
633
785
  | `simplify` | inherited ('auto') | vec_io's `simplify` for every series: `"auto"`, `True`, a dpi or `False`. |
634
786
  | `color_map` | inherited ('rainbow_llhh') | Default color map (alias `cmap`): of heatmaps, contours and numbers given as colors. |
@@ -645,42 +797,83 @@ Groups: `Stroke` (`border_`), `Font`, `NumberFormat`.
645
797
 
646
798
  ### Title
647
799
 
800
+ ```python
801
+ p.title("Yield") # the main title
802
+ p.add_title("Subtitle", order=-1) # between the main title and the axes
803
+ p.add_title("n = 120", side="bottom", align="start")
804
+ p.add_title("Batch 1", side="left", rule=True)
805
+ ```
806
+
807
+ A plot has a main title (`p.title`) and any number of others (`p.add_title`, which
808
+ returns the title; `p.titles` lists them, main first), each on a `side` of the plot.
809
+ The titles of one side stack outward from the axes, outermost of the side's bands (past
810
+ the axis, twin axes, an outside legend and attached colorbars): the main title nearest,
811
+ then the others in creation order; `order` places a title elsewhere, lower nearer
812
+ (`order=-1`: a subtitle between the main title and the axes). Each takes a band of its
813
+ `pad`, its text across the side and, with a `rule`, `rule_width + rule_gap`; the rule runs
814
+ along its span (`over`). `\n` starts a line, `line_height` apart; the last line is
815
+ nearest the axes on top and on the left and right, the first at the bottom. Left titles
816
+ read upward, right titles downward (`rotation="auto"`); `rotation=0` sets them
817
+ horizontal, beside the axes.
818
+
819
+ `align` takes the vocabulary of figure legends and colorbars: `start`, `center`, `end`, or
820
+ an end by name. On top and bottom, `start` is the left end (`left`, `right` name the
821
+ ends); on the left and right, `start` is where the text begins (the bottom for text
822
+ reading upward, else the top) and `top`, `bottom` name the ends.
823
+
648
824
  <!-- settings:Title -->
649
825
  | Setting | Default | Meaning |
650
826
  |---|---|---|
651
- | `text` | — | Title text: a string or rich content. |
827
+ | `text` | — | Title text: a string or rich content; `\n` starts a line. |
828
+ | `side` | 'top' | `top`, `bottom`, `left` or `right`. |
829
+ | `align` | 'center' | Alignment along the side: `start`, `center`, `end`, or an end by name: `left`, `right` on top and bottom, `top`, `bottom` on the left and right; there `start` is where rotated text begins (the bottom at 90, the top at −90 and 0). |
830
+ | `over` | 'axes' | Span the title is aligned within: the axes, or the axes and the axis labels beside them (the y axis' on top and bottom, the x axis' on the left and right). |
831
+ | `rotation` | 'auto' | `auto`: 0 on top and bottom, 90 on the left (reads upward), −90 on the right (reads downward); or 0, 90, −90. |
832
+ | `pad` | 5.0 | Gap between the title and what it covers. Length; `%`: of the axes height. |
833
+ | `order` | — | Place in its side's stack: lower is nearer; unset: the main title nearest, then the others in creation order. |
834
+ | `rule` | False | A line along the span: `True` or `"inside"` between the title and what it covers, `"outside"` beyond the title, `False` none. |
835
+ | `rule_color` | 'var(color)' | Color of the rule. |
836
+ | `rule_width` | 'var(line_width)' | Thickness of the rule. Length. |
837
+ | `rule_gap` | '0.5em' | Gap between the rule and the title. Length; `%`: of the font size. |
652
838
  | `font_size` | '1em' | Font size; default the base font size. Length; `%`: of the parent's font size. |
653
839
  | `font_weight` | 'normal' | `normal`, `bold` or a weight 1–1000. |
654
840
  | `font_style` | 'normal' | `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
655
841
  | `color` | 'var(text_color)' | Text color. |
656
- | `align` | 'center' | Alignment over the axes. |
657
- | `pad` | 5.0 | Gap above the axes. Length; `%`: of the axes height. |
658
- | `over` | 'axes' | Width the title is aligned within: the axes, or the axes and the y axis labels. |
659
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
842
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
660
843
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
661
844
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
662
845
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
846
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
847
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
663
848
 
664
849
  Groups: `TextStyle`, `Font`.
665
850
  <!-- /settings -->
666
851
 
667
852
  ### Legend
668
853
 
854
+ ```python
855
+ p.add_legend("top_left", frame=True) # the plot's legend, p.legend; returns it
856
+ fig.plot(legend="outside_right") # the same, when the plot is made
857
+ ```
858
+
669
859
  One entry per series with a `name`, drawn as the series draws itself (marker, line,
670
860
  swatch or box), or with `glyph="box"`, `"circle"` or `"line"` in the series color. At
671
861
  `top`, `bottom`, `outside_top` and `outside_bottom` entries are side by side unless
672
- `orientation` or `columns` is set.
673
-
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).
862
+ `orientation` or `columns` is set. Outside the axes, without `columns`, entries wrap
863
+ within the axes' length along their side: into rows as wide as the axes on top and
864
+ bottom, into columns as tall as the axes on the right.
865
+
866
+ **Size keys in the legend.** A series whose `size` goes through a
867
+ [size axis](#6-color-and-size-axes) has a size key, the axis' guide: by default a key
868
+ like a colorbar's ([size keys](#size-keys)); with `size_key="legend"`, rows in its
869
+ plot's legend, below the series entries: the axis' `label` (default: the `size` column
870
+ name) as a header, then sample markers at their real size with their values (the axis'
871
+ `ticks`, else 3–5 nice numbers inside its limits; in its `tick_format`). Series sharing
872
+ one size axis (one `fig.size_axis()`, or own axes trained as one by `share_size` or
873
+ `group=`) share one key, in grey, also across plots. The key goes in the legend of the
874
+ rightmost of their plots, and the topmost of those, so it sits at the figure's top
875
+ right. Users with different `size_map`s get a key per map. A single series' key takes
876
+ its color (grey when its colors are mapped).
684
877
  `fig.size_legend(source, id=…, values=None, title=None)` places the key of a size axis
685
878
  (or of a series' one) in its own grid area, as colorbars do. It shows every series of
686
879
  that axis, and no plot legend repeats it.
@@ -699,7 +892,7 @@ candidate covers more than 2 % marked cells; else the candidate covering the few
699
892
  <!-- settings:Legend -->
700
893
  | Setting | Default | Meaning |
701
894
  |---|---|---|
702
- | `position` | 'auto' | `auto`, `top_right`, `top_left`, `bottom_right`, `bottom_left`, `top`, `bottom`, `outside_right`, `outside_top`, `outside_bottom` or `none`. |
895
+ | `position` | 'auto' | `auto`, `top_right`, `top_left`, `bottom_right`, `bottom_left`, `top`, `bottom`, `center_right`, `center_left`, `outside_right`, `outside_top`, `outside_bottom` or `none`. |
703
896
  | `columns` | 1 | Number of columns. |
704
897
  | `frame` | False | Draw a frame and background. |
705
898
  | `title` | 'auto' | Legend title; `"auto"`: the `group` column name, if any. |
@@ -710,8 +903,8 @@ candidate covers more than 2 % marked cells; else the candidate covering the few
710
903
  | `frame_width` | 0.5 | Frame line width. Length. |
711
904
  | `pad` | 5.0 | Gap to the axes. Length; `%`: of the axes width (across) or height (down). |
712
905
  | `frame_radius` | 0.0 | Corner radius of the frame. Length. |
713
- | `frame_alpha` | 1.0 | Opacity of the frame and background. |
714
- | `glyph_alpha` | — | Fill opacity of `box` and `circle` symbols, outlined in the opaque color; default: the series' own fill. |
906
+ | `frame_opacity` | 1.0 | Opacity of the frame and background. |
907
+ | `glyph_opacity` | — | Fill opacity of `box` and `circle` symbols, outlined in the opaque color; default: the series' own fill. |
715
908
  | `glyph` | 'series' | Entry symbol: as the series draws itself, or a filled `box`, a `circle` or a `line` in the series color. |
716
909
  | `orientation` | 'auto' | `horizontal`: entries side by side; `auto`: horizontal at `top`, `bottom`, `outside_top` and `outside_bottom`. |
717
910
  | `glyph_length` | '1.4em' | Width of an entry's symbol. Length; `%`: of the font size. |
@@ -720,14 +913,68 @@ candidate covers more than 2 % marked cells; else the candidate covering the few
720
913
  | `column_gap` | '1em' | Gap between columns. Length; `%`: of the font size. |
721
914
  | `title_gap` | '0.3em' | Gap below the title. Length; `%`: of the font size. |
722
915
  | `inner_pad` | 'auto' | Space inside the box; `"auto"`: 0.5em with a frame, 0.15em without. Length; `%`: of the font size. |
723
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
916
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
724
917
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
725
918
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
726
919
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
920
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
921
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
727
922
 
728
923
  Groups: `TextStyle`, `Stroke` (`frame_`), `Font`.
729
924
  <!-- /settings -->
730
925
 
926
+ #### Figure legends
927
+
928
+ ```python
929
+ fig.add_legend(plots=[a, b], side="right", **settings) # returns it
930
+ fig.add_legend() # every plot, on the right
931
+ fig.legends
932
+ fig = pl.Figure(cols=2, share_legend="row") # one legend per row
933
+ ```
934
+
935
+ A figure legend shows the entries of a set of plots (plots or their series; default every
936
+ plot) in one legend, in the lanes beside them as [figure titles](#figure-title) are: its
937
+ plots' cells must fill the grid rectangle they span (a plot inside it but not given is an
938
+ error naming it).
939
+
940
+ * **Entries.** Its plots' entries, in plot order (row by row), then in series order.
941
+ Entries with the same label and the same symbol (what the legend draws for them: kind,
942
+ colors, marker, line style and width) are one entry; the same label with another
943
+ symbol keeps both. A size key whose series' plots the legend all covers goes into it
944
+ (the first such legend), one key per shared size axis as in a plot legend.
945
+ * **Plot legends.** Its plots' legends lose those entries, and a plot left without
946
+ entries shows no legend. A plot whose `legend.position` is set keeps its legend whole
947
+ (the figure legend shows its entries too).
948
+ * **Place.** `side` (`top`, `bottom`, `left`, `right`) and `align` along the side
949
+ (`start`: the left or top end, `center`, `end`; or `left`, `right` on top and bottom,
950
+ `top`, `bottom` on the left and right) within the axes of its plots, kept within the figure; the
951
+ figure grows when the legend is longer than its content. On top and bottom, entries
952
+ are side by side in rows as wide as the span (unless `columns` is set); on the left and
953
+ right, in a column (`columns`).
954
+ * **Lanes.** Legends and figure titles share the lanes and their rules (nesting, then
955
+ shared lanes for disjoint spans, then creation order; `order` overrides); over the same
956
+ plots, a legend is nearer the plots than a title. A legend without entries takes no
957
+ lane.
958
+ * **`share_legend`** (`False`, `True`/`"all"`, `"row"`, `"col"`) makes figure legends for
959
+ the groups `share_color` would make (two plots or more): one on the right of the
960
+ figure (`"all"`), of each row (`"row"`), one at the bottom of each column (`"col"`).
961
+ A group with a plot an `add_legend` legend covers gets none. They take the
962
+ `FigureLegend` (and `Legend`) keys of the style, but their `side`.
963
+ * `p.save()` (one plot alone) leaves out figure legends: the plot's legend shows all its
964
+ entries.
965
+
966
+ Figure legends have the settings of plot legends but `position`, `orientation`, and:
967
+
968
+ <!-- settings:FigureLegend -->
969
+ | Setting | Default | Meaning |
970
+ |---|---|---|
971
+ | `side` | 'right' | `top`, `bottom`, `left` or `right` of its plots. |
972
+ | `align` | 'center' | Alignment along the side: `start` (left, or top), `center`, `end` (right, or bottom), or an end by name: `left`, `right` on top and bottom, `top`, `bottom` on the left and right. |
973
+ | `order` | — | Place in its side's lanes, as figure titles' `order`: lower is nearer the plots. |
974
+ | `pad` | 5.0 | Gap between the legend and the plots. Length. |
975
+ | `title` | 'auto' | Legend title; `"auto"`: the `group` column name of its plots' series, if any. |
976
+ <!-- /settings -->
977
+
731
978
  ### Decorations
732
979
 
733
980
  Reference lines, bands, text and annotations. They take no palette color, are in the
@@ -755,12 +1002,12 @@ HLine:
755
1002
  | Setting | Default | Meaning |
756
1003
  |---|---|---|
757
1004
  | `color` | '#4d4d4d' | Line color. |
758
- | `line_width` | inherited (0.75) | Line width. Length. |
1005
+ | `line_width` | inherited (0.5) | Line width. Length. |
759
1006
  | `line_style` | 'solid' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list. Length. |
760
1007
  | `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
1008
  | `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. |
762
1009
  | `name` | — | Legend entry; unset: not in the legend. |
763
- | `alpha` | 1.0 | Opacity. |
1010
+ | `opacity` | 1.0 | Opacity. |
764
1011
  | `z` | 1.0 | Drawing order among the series (default 0). |
765
1012
  | `extend_limits` | False | Include the decoration in the axis limits. |
766
1013
  | `clip` | True | Clip to the axes area. |
@@ -774,10 +1021,10 @@ AxLine:
774
1021
  | Setting | Default | Meaning |
775
1022
  |---|---|---|
776
1023
  | `color` | '#4d4d4d' | Line color. |
777
- | `line_width` | inherited (0.75) | Line width. Length. |
1024
+ | `line_width` | inherited (0.5) | Line width. Length. |
778
1025
  | `line_style` | 'solid' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list. Length. |
779
1026
  | `name` | — | Legend entry; unset: not in the legend. |
780
- | `alpha` | 1.0 | Opacity. |
1027
+ | `opacity` | 1.0 | Opacity. |
781
1028
  | `z` | 1.0 | Drawing order among the series (default 0). |
782
1029
  | `extend_limits` | False | Include the decoration in the axis limits. |
783
1030
  | `clip` | True | Clip to the axes area. |
@@ -796,7 +1043,7 @@ HSpan:
796
1043
  | `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
1044
  | `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. |
798
1045
  | `name` | — | Legend entry; unset: not in the legend. |
799
- | `alpha` | 1.0 | Opacity. |
1046
+ | `opacity` | 1.0 | Opacity. |
800
1047
  | `z` | -1.0 | Drawing order among the series (default 0). |
801
1048
  | `extend_limits` | False | Include the decoration in the axis limits. |
802
1049
  | `clip` | True | Clip to the axes area. |
@@ -815,15 +1062,17 @@ Text:
815
1062
  | `coords` | 'data' | `data`, `axes` (0–1) or `figure` (0–1). |
816
1063
  | `color` | 'var(text_color)' | Text color; default `text_color`. |
817
1064
  | `font_size` | inherited (11.0) | Font size. Length; `%`: of the parent's font size. |
818
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1065
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
819
1066
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
820
1067
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
821
1068
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1069
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1070
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
822
1071
  | `font_weight` | 'normal' | `normal`, `bold` or a weight 1–1000. |
823
1072
  | `font_style` | 'normal' | `normal`, `italic`, `oblique` or `"oblique 10deg"`. |
824
1073
  | `text_color` | inherited ('black') | Text color. |
825
1074
  | `name` | — | Legend entry; unset: not in the legend. |
826
- | `alpha` | 1.0 | Opacity. |
1075
+ | `opacity` | 1.0 | Opacity. |
827
1076
  | `z` | 1.0 | Drawing order among the series (default 0). |
828
1077
  | `extend_limits` | False | Include the decoration in the axis limits. |
829
1078
  | `clip` | False | Clip to the axes area. |
@@ -842,7 +1091,7 @@ Annotate:
842
1091
  | `arrow` | True | Draw an arrow from the text to `xy`. |
843
1092
  | `arrow_style` | '->' | `->` (open head), `-\|>` (filled head) or `-` (no head). |
844
1093
  | `arrow_color` | 'var(color)' | Arrow color; default the text color. |
845
- | `arrow_width` | 0.75 | Arrow line width. Length. |
1094
+ | `arrow_width` | 0.5 | Arrow line width. Length. |
846
1095
  | `head_length` | 7.0 | Arrowhead length. Length. |
847
1096
  | `shrink` | 3.0 | Gap left at both ends of the arrow. Length. |
848
1097
 
@@ -910,9 +1159,13 @@ grid only when its axis asks). `p.save` includes its twins.
910
1159
 
911
1160
  * `"auto"`: the union of the series' extents plus `padding` (0.05 of the range per side,
912
1161
  in position space: a factor on log axes; heatmaps take none).
913
- * `"lo/hi"`: each side `min`, `max`, a number or `q:F` (quantile F of the axis's values):
914
- `"0/max"`, `"q:0.01/q:0.99"`. Or `(lo, hi)`, `None` meaning automatic.
915
- * A single value is widened by ±0.5 in position space. `invert=True` reverses the axis.
1162
+ * `"lo/hi"`: each side `min`, `max` (any case), a number, an ISO date or time, or `q:F`
1163
+ (quantile F of the axis's values): `"0/max"`, `"q:0.01/q:0.99"`,
1164
+ `"2024-01-01T10:00Z/2024-02-01"`. Or `(lo, hi)`, `None` meaning automatic.
1165
+ * A single value is widened by ±0.5 in position space; a single time by one unit of its
1166
+ data each side (a day at midnight, else an hour, a minute, a second).
1167
+ * `invert=True` reverses the axis; so do limits given high to low, `(2, 0)` (with
1168
+ `invert=True` too, the axis is reversed once).
916
1169
  * `include_zero=True` extends automatic limits to 0 (linear and sqrt axes) before padding
917
1170
  and `snap`; `"auto"` does so where a series on the axis asks for it, following
918
1171
  Vega-Lite's default: both axes of scatter plots, the value axis of lines, areas and
@@ -944,9 +1197,6 @@ grid only when its axis asks). `p.save` includes its twins.
944
1197
  * `tick_format` takes any [number format](#number-formats); the default `"auto"` is the
945
1198
  rule above.
946
1199
 
947
- Category axes of heatmaps draw labels only (no axis line or ticks) unless `tick_length`
948
- or the plot's `spines` is set.
949
-
950
1200
  * **Grid lines:** `grid` at the major ticks, `minor_grid` at the minor ticks (or halfway
951
1201
  between major ticks on linear axes without minor ticks), and `zero_line` at 0 (when 0
952
1202
  is within the limits), under the series.
@@ -977,7 +1227,7 @@ or the plot's `spines` is set.
977
1227
  | `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
1228
  | `auto_padding` | '5%' | The fraction `padding="auto"` adds on each side. Length; `%`: of the axis range. |
979
1229
  | `sticky` | True | No padding past the baseline of bars and histograms when an automatic limit is on it (matplotlib's sticky edges). |
980
- | `invert` | False | Reverse the axis. |
1230
+ | `invert` | False | Reverse the axis (limits given high to low, `(2, 0)`, reverse it too). |
981
1231
  | `ticks` | — | `False` (no ticks) or a list of tick values. |
982
1232
  | `tick_labels` | — | Labels of `ticks`. |
983
1233
  | `minor_ticks` | — | `True`, `False` or a list of values; default: on for log10. |
@@ -990,19 +1240,19 @@ or the plot's `spines` is set.
990
1240
  | `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`. |
991
1241
  | `auto_max_ticks` | (10, 8) | Most automatic ticks on numeric and time axes. |
992
1242
  | `sci_limits` | (-4, 5) | Exponents beyond which labels become mantissas × 10ᵏ. |
993
- | `tick_length` | 5.0 | Tick length. Length; `%`: of the axes side across the axis. |
1243
+ | `tick_length` | 6.0 | Tick length. Length; `%`: of the axes side across the axis. |
994
1244
  | `minor_tick_length` | '60%' | Minor tick length; default 0.6 × `tick_length`. Length; `%`: of `tick_length`. |
995
1245
  | `tick_direction` | 'out' | `out`, `in` or `both`. |
996
1246
  | `tick_color` | 'var(color)' | Tick color. |
997
- | `tick_width` | 0.75 | Tick line width. Length. |
1247
+ | `tick_width` | 0.5 | Tick line width. Length. |
998
1248
  | `tick_label_font_size` | '1em' | Font size of tick labels. Length; `%`: of the font size. |
999
1249
  | `tick_label_weight` | 'normal' | Tick label weight: `normal`, `bold` or 1–1000. |
1000
1250
  | `tick_label_color` | 'var(color)' | Tick label color. |
1001
- | `tick_pad` | 3.0 | Gap between ticks and labels. Length; `%`: of the axes side across the axis. |
1002
- | `label_pad` | 4.0 | Gap between tick labels and the label. Length; `%`: of the axes side across the axis. |
1251
+ | `tick_pad` | 5.0 | Gap between ticks and labels. Length; `%`: of the axes side across the axis. |
1252
+ | `label_pad` | 5.0 | Gap between tick labels and the label. Length; `%`: of the axes side across the axis. |
1003
1253
  | `color` | 'var(text_color)' | Color of the axis line, ticks and labels (the default of `line_color`, `tick_color`, `tick_label_color`, `label_color`). |
1004
1254
  | `line_color` | 'var(color)' | Axis line color. |
1005
- | `line_width` | 0.75 | Axis line width. Length. |
1255
+ | `line_width` | 0.5 | Axis line width. Length. |
1006
1256
  | `side` | x: 'bottom' / y: 'left' | Where the ticks, labels and axis line go: `bottom` or `top` (x axis), `left` or `right` (y axis). |
1007
1257
  | `mirror` | False | Ticks also on the opposite side of the axes. |
1008
1258
  | `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. |
@@ -1022,10 +1272,12 @@ or the plot's `spines` is set.
1022
1272
  | `minor_grid_style` | 'var(grid_style)' | Minor grid style; default `grid_style`. Length. |
1023
1273
  | `visible` | True | Draw the axis (ticks, labels). |
1024
1274
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1025
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1275
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1026
1276
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1027
1277
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1028
1278
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1279
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1280
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1029
1281
  | `text_color` | inherited ('black') | Text color. |
1030
1282
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1031
1283
  | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
@@ -1039,7 +1291,7 @@ Groups: `TextStyle` (`label_`), `Stroke` (`tick_`), `TextStyle` (`tick_label_`),
1039
1291
 
1040
1292
  ## 5. Series
1041
1293
 
1042
- All series take `name`, `alpha`, `z`, `rasterize` and `simplify` (see [Output](#8-output)).
1294
+ All series take `name`, `opacity`, `z`, `rasterize` and `simplify` (see [Output](#8-output)).
1043
1295
  Series without their own color take the plot's next palette color, in call order; series
1044
1296
  with several value sets (histograms, densities, areas, pies) take one per set.
1045
1297
 
@@ -1054,7 +1306,7 @@ with several value sets (histograms, densities, areas, pies) take one per set.
1054
1306
  stem, regression): its x data go along the y axis, its y data along the x axis, and it
1055
1307
  draws the same marks with x and y swapped (curves along y, steps included). Grids
1056
1308
  (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
1309
+ * **New types.** `pl.registry.layers.add(name, factory)` adds `plot.<name>(…)`, which calls
1058
1310
  `factory(…, plot=plot)`. A factory that is a `pl.Series` subclass implements
1059
1311
  `layers()`, returning its `Call` (layers, legend entries, what the axes, maps and
1060
1312
  palette need; see `plot_io/layers/`); its class name is a style class. The genome types
@@ -1068,10 +1320,21 @@ with several value sets (histograms, densities, areas, pies) take one per set.
1068
1320
  count as one, and so do split violins.
1069
1321
  * **Stacking.** `stack=True` (bars, histograms, densities) puts a series on the previous
1070
1322
  stacked series of its kind in the plot, per category or bin; positive and negative
1071
- values stack apart; `stack="normalize"` divides each position by its total.
1323
+ values stack apart; `stack="normalize"` divides each position by its total. Stacked
1324
+ densities share one grid (the union of their spans).
1325
+ * **Fill and opacity.** `fill` turns a series' fills on (`True`: their own colors, or a
1326
+ color) or off (`False`) on every plot type that fills, and `fill_opacity` is their
1327
+ opacity; `opacity` is the opacity of the whole series (fills, lines and outlines),
1328
+ multiplying `fill_opacity`.
1072
1329
  * **Derived data.** Histograms, densities, ECDFs, violins, 2-D bins, contours and
1073
- regressions compute their data once (in C, by plot_io's kernels) and keep it until
1074
- a setting changes; `series.stats` exposes it.
1330
+ regressions compute their data once (in C, by plot_io's kernels) and keep it while
1331
+ the settings they read resolve to the same values (a style change recomputes it);
1332
+ `series.stats` exposes it. On an axis with a scale they are computed in the axis'
1333
+ space: bins are even there, and densities (`hist` and `hist2d` `stat="density"`,
1334
+ `kde`, `violin`, 2-D `kde`) are per axis unit (on a log axis, per log unit), so a
1335
+ histogram and a density of the same data agree. Degenerate data draw nothing (an
1336
+ empty set, all NaN) or, for a density without a bandwidth (one value, all equal), no
1337
+ curve and a warning; a violin of one value is a line at it.
1075
1338
  * **Shifted and rescaled coordinates.** `x_origin`, `x_scale` and `x_extent` (and `y_…`)
1076
1339
  draw a series' values `v` at `(v − origin) × scale`, without changing the data:
1077
1340
  `p.line(profile, x_origin="center")` draws positions 0…1000 at −500…500, `x_scale=10`
@@ -1105,7 +1368,7 @@ p = pl.Plot(data=df); p.scatter("a", "b") # data inherited by the plot's s
1105
1368
  `data` is any object returning a column for `data[name]`: a dict of sequences, a pandas
1106
1369
  or polars data frame, a numpy structured array. Columns are read through `__getitem__`
1107
1370
  (and `to_numpy()` when present); no table library is imported. With `data`, a string in
1108
- a positional data argument or in `color`, `edge_color`, `size`, `alpha`, `group`,
1371
+ a positional data argument or in `color`, `edge_color`, `size`, `opacity`, `group`,
1109
1372
  `draw_order`, `x_error`, `y_error`, `weights`, `positions`, `x`, `y` or `names` names a
1110
1373
  column. Positional arguments, `group`, `weights` and `positions` must be columns; in
1111
1374
  `color`, a color name that is no column stays a color (a column wins, with a warning if
@@ -1115,14 +1378,26 @@ the colorbar label to the `color` column, the legend title to the `group` column
1115
1378
  columns keep their category order for groups and category axes.
1116
1379
 
1117
1380
  Box, violin, strip and swarm also take long data: `values` flat, with the category of each
1118
- value in `x` (`y` when horizontal).
1381
+ value in `x` (`y` when horizontal). [Dots](#dots) take one row per cell.
1382
+
1383
+ ```python
1384
+ t = pl.group_summary(values, groups, names=None, threshold=0.0, mean="all")
1385
+ p.dots(data=t, x="name", y="group", color="mean", size="fraction", size_limits="0/1")
1386
+ ```
1387
+
1388
+ `group_summary` summarizes an observations × variables matrix (rows: observations; a 2-D
1389
+ buffer or a list of rows) per group: columns `group`, `name` (the variable; default its
1390
+ index), `mean` and `fraction` (the share of the group's observations above `threshold`).
1391
+ `mean="expressed"` averages only the observations above `threshold` (none: a missing
1392
+ mean). Groups in order of first appearance (a categorical: its order); missing labels are
1393
+ left out.
1119
1394
 
1120
1395
  ### Groups (`group=`)
1121
1396
 
1122
1397
  ```python
1123
1398
  g = p.scatter(x, y, group=labels, marker="auto") # one series per group
1124
1399
  g = p.line(t, y, group=subject, line_style="auto")
1125
- g["a"].set(color="black"); g.set(alpha=0.6)
1400
+ g["a"].set(color="black"); g.set(opacity=0.6)
1126
1401
  ```
1127
1402
 
1128
1403
  `group` takes a label per point. The call returns a `SeriesGroup`, a list of one series per
@@ -1150,7 +1425,7 @@ the style's map); numbers in `size` are diameters, or values mapped through `siz
1150
1425
  * `size` is a diameter (a length; per-point numbers are px). With `size_basis="area"` (default) every shape has the
1151
1426
  area of the circle of that diameter: a square of size 4 is drawn 3.54 px wide.
1152
1427
  * Error bars: `x_error`/`y_error` take a value, a sequence, `(low, high)` sequences or
1153
- `ErrorBars(values, color=None, line_width=None, cap_length=None)` (cap: the series'
1428
+ `Errors(values, color=None, line_width=None, cap_length=None)` (cap: the series'
1154
1429
  `cap_length`, else 4 px).
1155
1430
 
1156
1431
  <!-- settings:Scatter -->
@@ -1160,8 +1435,9 @@ the style's map); numbers in `size` are diameters, or values mapped through `siz
1160
1435
  | `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. |
1161
1436
  | `color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1162
1437
  | `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. |
1438
+ | `edge_width` | 0.5 | Outline width; 0: no outline. Length. |
1439
+ | `fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
1440
+ | `fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1165
1441
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1166
1442
  | `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
1443
  | `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. |
@@ -1171,11 +1447,11 @@ the style's map); numbers in `size` are diameters, or values mapped through `siz
1171
1447
  | `size_limits` | — | Limits of the series' size axis, as an axis' `limits`; unset: `"auto"`. |
1172
1448
  | `size_scale` | — | Scale of the series' size axis; unset: `linear`. |
1173
1449
  | `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). |
1450
+ | `size_key` | 'key' | With mapped sizes: a key attached to the plot, as a colorbar's (`"key"`), sample rows in the legend (`"legend"`), none (`False`), or the values to show (a list: a key with a marker at each). |
1175
1451
  | `draw_order` | — | Drawing order: `"density"` (densest drawn last), `"-density"`, or sort keys per point (ascending); default: call order. |
1176
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own; or `"density"` / a `Density`, mapped linearly to `alpha_range`. |
1177
- | `alpha_range` | (0.2, 1.0) | Opacities of the least and most dense points when `alpha` is a density. |
1178
- | `x_error` | — | Horizontal error bars: a value, a sequence, `(low, high)` or `ErrorBars`. |
1452
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own; or `"density"` / a `Density`, mapped linearly to `opacity_range`. |
1453
+ | `opacity_range` | (0.2, 1.0) | Opacities of the least and most dense points when `opacity` is a density. |
1454
+ | `x_error` | — | Horizontal error bars: a value, a sequence, `(low, high)` or `Errors`. |
1179
1455
  | `y_error` | — | Vertical error bars. |
1180
1456
  | `orientation` | 'vertical' | `vertical` (x along the x axis) or `horizontal` (x along the y axis). |
1181
1457
  | `name` | — | Legend entry; unset: not in the legend. |
@@ -1184,10 +1460,12 @@ the style's map); numbers in `size` are diameters, or values mapped through `siz
1184
1460
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1185
1461
  | `text_color` | inherited ('black') | Text color. |
1186
1462
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1187
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1463
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1188
1464
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1189
1465
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1190
1466
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1467
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1468
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1191
1469
 
1192
1470
  Groups: `Marker`, `Font`.
1193
1471
  <!-- /settings -->
@@ -1202,7 +1480,7 @@ Named line styles scale with the width. Markers (`marker`, `marker_size`,
1202
1480
  `marker_color`, …) are drawn at the points when `marker` or `show_markers` is set.
1203
1481
  Numbers per point (or `"density"`, of a single line) in `marker_color` and
1204
1482
  `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
1483
+ (`color_map`, `color_limits`, `color_scale`, `color_axis`; `p.add_colorbar(line)`), as
1206
1484
  `color` does on Scatter; the line keeps `color`, and the legend's marker takes the
1207
1485
  gradient's middle color.
1208
1486
 
@@ -1219,7 +1497,7 @@ gradient's middle color.
1219
1497
  | Setting | Default | Meaning |
1220
1498
  |---|---|---|
1221
1499
  | `color` | — | Line color; default: the next palette color. |
1222
- | `line_width` | inherited (0.75) | Line width. Length. |
1500
+ | `line_width` | inherited (0.5) | Line width. Length. |
1223
1501
  | `line_style` | 'solid' | `solid`, `dashed`, `dotted`, `dashdot` or a dash list; named styles scale with the width. Length. |
1224
1502
  | `cap` | 'butt' | Line cap. |
1225
1503
  | `join` | 'round' | Line join. |
@@ -1229,8 +1507,9 @@ gradient's middle color.
1229
1507
  | `marker_size` | 4.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1230
1508
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1231
1509
  | `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. |
1510
+ | `marker_edge_width` | 0.5 | Outline width; 0: no outline. Length. |
1511
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
1512
+ | `marker_fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1234
1513
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1235
1514
  | `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
1515
  | `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. |
@@ -1241,16 +1520,18 @@ gradient's middle color.
1241
1520
  | `show_markers` | False | Draw markers at the points (also turned on by setting `marker`). |
1242
1521
  | `orientation` | 'vertical' | `vertical` (x along the x axis) or `horizontal` (x along the y axis). |
1243
1522
  | `name` | — | Legend entry; unset: not in the legend. |
1244
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1523
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1245
1524
  | `z` | — | Drawing order (higher on top); default: call order. |
1246
1525
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1247
1526
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1248
1527
  | `text_color` | inherited ('black') | Text color. |
1249
1528
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1250
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1529
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1251
1530
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1252
1531
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1253
1532
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1533
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1534
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1254
1535
 
1255
1536
  Groups: `Stroke`, `Marker` (`marker_`), `Font`.
1256
1537
  <!-- /settings -->
@@ -1272,7 +1553,7 @@ each side in its color).
1272
1553
  |---|---|---|
1273
1554
  | `color` | — | Fill color; default: the next palette color. |
1274
1555
  | `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. |
1556
+ | `opacity` | 'calc(0.3 * inherit)' | Opacity; default 0.3 × the plot's. |
1276
1557
  | `edge_color` | — | Outline color; default none. |
1277
1558
  | `edge_width` | 'var(line_width)' | Outline width; default the line width. Length. |
1278
1559
  | `interpolation` | 'linear' | How points are joined: `linear`, `step-pre`, `step-post`, `step-mid`, `monotone` (a curve that never overshoots) or `spline` (centripetal Catmull–Rom). |
@@ -1284,10 +1565,12 @@ each side in its color).
1284
1565
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1285
1566
  | `text_color` | inherited ('black') | Text color. |
1286
1567
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1287
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1568
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1288
1569
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1289
1570
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1290
1571
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1572
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1573
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1291
1574
 
1292
1575
  Groups: `Stroke` (`edge_`), `Font`.
1293
1576
  <!-- /settings -->
@@ -1315,7 +1598,7 @@ category.
1315
1598
  | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1316
1599
  | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1317
1600
  | `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). |
1318
- | `edge_width` | 0.75 | Outline width. Length. |
1601
+ | `edge_width` | 'var(line_width)' | Outline width. Length. |
1319
1602
  | `whisker_color` | — | Whisker and cap color; default `edge_color`. |
1320
1603
  | `whisker_width` | 'var(edge_width)' | Whisker and cap width; default `edge_width`. Length. |
1321
1604
  | `whisker_style` | 'solid' | Whisker line style: `solid`, `dashed`, `dotted`, `dashdot` or a dash list (caps stay solid). Length. |
@@ -1327,7 +1610,8 @@ category.
1327
1610
  | `whiskers` | 1.5 | Whisker reach: a multiple of the IQR, `"range"`, or percentiles `(lo, hi)`. |
1328
1611
  | `outliers` | True | Draw points beyond the whiskers. |
1329
1612
  | `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`. |
1613
+ | `fill` | True | Fill: `True` (the box's color), a color, or `False`. |
1614
+ | `fill_opacity` | 0.25 | Opacity of the fill, times `opacity` (lines keep `opacity`). |
1331
1615
  | `mean` | False | Draw the mean as a marker. |
1332
1616
  | `mean_marker` | 'diamond' | Marker of the mean. |
1333
1617
  | `mean_color` | 'white' | Fill of the mean marker (outline: `edge_color`). |
@@ -1340,19 +1624,22 @@ category.
1340
1624
  | `marker_color` | — | Outlier fill: a color, or colors per outlier. |
1341
1625
  | `marker_edge_color` | — | Outlier outline: as the fill, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1342
1626
  | `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. |
1627
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
1628
+ | `marker_fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1344
1629
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1345
1630
  | `name` | — | Legend entry; unset: not in the legend. |
1346
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1631
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1347
1632
  | `z` | — | Drawing order (higher on top); default: call order. |
1348
1633
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1349
1634
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1350
1635
  | `text_color` | inherited ('black') | Text color. |
1351
1636
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1352
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1637
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1353
1638
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1354
1639
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1355
1640
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1641
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1642
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1356
1643
 
1357
1644
  Groups: `Stroke` (`edge_`), `Stroke` (`whisker_`), `Stroke` (`median_`), `FillStyle`, `Marker` (`marker_`), `Font`.
1358
1645
  <!-- /settings -->
@@ -1387,16 +1674,18 @@ all cells), in black or white, whichever contrasts more (at most 2,500 cells unl
1387
1674
  | `value_label_font_size` | '0.9em' | Font size of cell labels. Length; `%`: of the font size. |
1388
1675
  | `colorbar` | False | Attach a colorbar to the plot. |
1389
1676
  | `name` | — | Legend entry; unset: not in the legend. |
1390
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1677
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1391
1678
  | `z` | — | Drawing order (higher on top); default: call order. |
1392
1679
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1393
1680
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1394
1681
  | `text_color` | inherited ('black') | Text color. |
1395
1682
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1396
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1683
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1397
1684
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1398
1685
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1399
1686
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1687
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1688
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1400
1689
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1401
1690
  | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1402
1691
  | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
@@ -1407,13 +1696,80 @@ all cells), in black or white, whichever contrasts more (at most 2,500 cells unl
1407
1696
  Groups: `TextStyle` (`value_label_`), `Font`, `NumberFormat`.
1408
1697
  <!-- /settings -->
1409
1698
 
1699
+ ### Dots
1700
+
1701
+ ```python
1702
+ pl.Dots(color=None, size=None, x=None, y=None, plot=None, **settings)
1703
+ p.dots(mean, size=fraction, x=genes, y=clusters, cmap="magma", size_limits="0/1")
1704
+ p.dots(data=table, x="gene", y="cluster", color="mean", size="fraction")
1705
+ ```
1706
+
1707
+ One dot per cell of a grid (a dot plot): `color` and `size` are 2-D grids of values (row
1708
+ 0 first) of one shape, or one value (a color, a diameter). `x`/`y` label the columns and
1709
+ rows, as a heatmap's: labels (category axes), `None` (indices), centres or edges. Values
1710
+ always map: colors through the series' [color axis](#6-color-and-size-axes) (a colorbar
1711
+ by default), sizes through its size axis (`size_map` `(0, 12)` px and `size_limits`
1712
+ `"0/max"`: area ∝ value; fractions: `"0/1"`) and its [size key](#size-keys), on the
1713
+ colorbar's line when both fit. A missing size leaves the cell empty; a missing color
1714
+ takes the map's `bad`.
1715
+
1716
+ * **Long data.** `x`, `y` and `color`/`size` per cell (columns with `data=`, or
1717
+ sequences), one row per cell; two rows for one cell are an error, cells without a row
1718
+ get no dot. Categories in order of first appearance (pandas or polars categoricals:
1719
+ theirs); `x_categories=`/`y_categories=` lists select and order them.
1720
+ * **`scale_color`.** `"rows"` / `"columns"` rescales color values to 0–1 in each row or
1721
+ column before mapping (one variable's range per column).
1722
+ * **Cells.** The axes' width (`Figure(width=…)`) sets the space per column; rotated
1723
+ labels closer than `category_label_spacing` are thinned out. `data_ratio=1` on the plot
1724
+ makes cells square.
1725
+
1726
+ <!-- settings:Dots -->
1727
+ | Setting | Default | Meaning |
1728
+ |---|---|---|
1729
+ | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
1730
+ | `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. |
1731
+ | `color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1732
+ | `edge_color` | 'auto' | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1733
+ | `edge_width` | 0.5 | Outline width; 0: no outline. Length. |
1734
+ | `fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
1735
+ | `fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1736
+ | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1737
+ | `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. |
1738
+ | `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. |
1739
+ | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1740
+ | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1741
+ | `size_map` | (0.0, 12.0) | The sizes numbers in `size` are drawn with: a `SizeMap` (alias `smap`); without it (or `size_axis`), numbers are sizes in px. |
1742
+ | `size_limits` | '0/max' | Limits of the series' size axis, as an axis' `limits`; unset: `"auto"`. |
1743
+ | `size_scale` | — | Scale of the series' size axis; unset: `linear`. |
1744
+ | `size_axis` | — | A shared `SizeAxis` (`figure.size_axis(…)`) in place of the series' own: it holds the sizes, limits and scale. |
1745
+ | `size_key` | 'key' | With mapped sizes: a key attached to the plot, as a colorbar's (`"key"`), sample rows in the legend (`"legend"`), none (`False`), or the values to show (a list: a key with a marker at each). |
1746
+ | `scale_color` | — | `rows` / `columns`: color values rescaled to 0–1 in each row or column before mapping; unset: as given. |
1747
+ | `origin` | 'top' | `top`: row 0 at the top (y axis inverted); `bottom`: at the bottom. |
1748
+ | `colorbar` | True | Attach a colorbar to the plot (with color values). |
1749
+ | `name` | — | Legend entry; unset: not in the legend. |
1750
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1751
+ | `z` | — | Drawing order (higher on top); default: call order. |
1752
+ | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1753
+ | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1754
+ | `text_color` | inherited ('black') | Text color. |
1755
+ | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1756
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1757
+ | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1758
+ | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1759
+ | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1760
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1761
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1762
+
1763
+ Groups: `Marker`, `Font`.
1764
+ <!-- /settings -->
1765
+
1410
1766
  ### Bar
1411
1767
 
1412
1768
  ```python
1413
1769
  pl.Bar(x, height=None, plot=None, **settings)
1414
1770
  ```
1415
1771
 
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"`).
1772
+ `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_opacity` is the opacity of the bars' fill (`fill`: a color in place of theirs); `error` adds error bars at the bar ends. Value axes include 0 (`include_zero="auto"`).
1417
1773
 
1418
1774
  <!-- settings:Bar -->
1419
1775
  | Setting | Default | Meaning |
@@ -1423,9 +1779,10 @@ pl.Bar(x, height=None, plot=None, **settings)
1423
1779
  | `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
1780
  | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1425
1781
  | `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. |
1782
+ | `edge_color` | 'series' | Outline color: a color, `"series"` (each bar's own color, at `opacity`) or none. |
1427
1783
  | `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`. |
1784
+ | `fill` | True | Fill: `True` (each bar's color), a color, or `False`. |
1785
+ | `fill_opacity` | 0.25 | Opacity of the fill, times `opacity` (outlines keep `opacity`). |
1429
1786
  | `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
1787
  | `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
1788
  | `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. |
@@ -1435,22 +1792,24 @@ pl.Bar(x, height=None, plot=None, **settings)
1435
1792
  | `dodge` | True | Bar series sharing a category share its slot side by side; `False` overlays them. |
1436
1793
  | `gap` | 0.0 | Fraction of each bar's part of a shared slot left empty. Length; `%`: of each series' part of a shared slot. |
1437
1794
  | `saturation` | 1.0 | Saturation of the fills (seaborn: 0.75). |
1438
- | `error` | — | Error bars at the bar ends: a value, a sequence, `(low, high)` or `ErrorBars`. |
1795
+ | `error` | — | Error bars at the bar ends: a value, a sequence, `(low, high)` or `Errors`. |
1439
1796
  | `error_color` | '#333333' | Error bar color. |
1440
- | `error_width` | 0.75 | Error bar line width. Length. |
1797
+ | `error_width` | 0.5 | Error bar line width. Length. |
1441
1798
  | `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
1799
  | `value_label_format` | 'auto' | Number format of the value labels. |
1443
1800
  | `name` | — | Legend entry; unset: not in the legend. |
1444
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1801
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1445
1802
  | `z` | — | Drawing order (higher on top); default: call order. |
1446
1803
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1447
1804
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1448
1805
  | `text_color` | inherited ('black') | Text color. |
1449
1806
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1450
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1807
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1451
1808
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1452
1809
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1453
1810
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1811
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1812
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1454
1813
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1455
1814
  | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1456
1815
  | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
@@ -1467,7 +1826,7 @@ Groups: `Stroke` (`edge_`), `FillStyle`, `Stroke` (`error_`), `Font`, `NumberFor
1467
1826
  pl.Hist(values, plot=None, **settings)
1468
1827
  ```
1469
1828
 
1470
- `values`: one array, or several (a dict, a list of arrays) sharing the bins. `bins`: a count, edges, or numpy's rules (`auto` is numpy 2's). Bins are even on the axis scale (`bins_scale="axis"`): on a log axis, in log space. `stat` turns counts into densities (area 1), probabilities, percents or counts per unit; `cumulative` accumulates them. Several sets overlay (opacity 0.5), stack (`stack=True`) or dodge (`dodge=True`). `hist.stats`: `edges`, `counts` and `heights` per set.
1829
+ `values`: one array, or several (a dict, a list of arrays) sharing the bins; dates draw on a time axis. `bins`: a count (at most 10⁶), edges, or numpy's rules (`auto` is numpy 2's; a rule asking for more than 10⁶ bins is an error). Bins are even on the axis scale (`bins_scale="axis"`): on a log axis, in log space; edges or a `range` outside the axis' scale (0 on a log axis) are refused. `stat` turns counts into densities (area 1), probabilities, percents or counts per unit, per unit of the axis' space; `cumulative` accumulates them. Several sets overlay (`fill="auto"`: opacity 0.5), stack (`stack=True`) or dodge (`dodge=True`). Bars have no outline by default (`edge_width` 0). `hist.stats`: `edges`, `counts` and `heights` per set.
1471
1830
 
1472
1831
  <!-- settings:Hist -->
1473
1832
  | Setting | Default | Meaning |
@@ -1475,33 +1834,37 @@ pl.Hist(values, plot=None, **settings)
1475
1834
  | `bins` | 'auto' | A count, edges, or a rule: `auto`, `fd`, `sturges`, `scott`, `sqrt`, `rice`, `doane` (numpy's). |
1476
1835
  | `range` | — | Range of the bins; default the data range. |
1477
1836
  | `weights` | — | A weight per value (per set for several sets). |
1478
- | `stat` | 'count' | `count`, `density` (area 1), `probability`, `percent` or `frequency` (count per unit). |
1837
+ | `stat` | 'count' | `count`, `density` (area 1), `probability`, `percent` or `frequency` (count per unit); densities and frequencies per unit of the axis' space (log axes: per log unit, as `kde`). |
1479
1838
  | `cumulative` | False | Accumulate the bins. |
1480
1839
  | `kind` | 'stepfilled' | `bar` (adjacent bars), `step` (outline) or `stepfilled`. |
1481
1840
  | `bins_scale` | 'axis' | `axis`: bins even on the axis scale (log axes: in log space); `linear`: even in data units. |
1482
1841
  | `orientation` | 'vertical' | `vertical` (bins along x) or `horizontal`. |
1483
1842
  | `stack` | False | Stack the sets (and other stacked histograms with the same bins). |
1484
1843
  | `dodge` | False | Put the sets side by side within each bin. |
1485
- | `color` | — | Fill color, or one per set; default palette colors. |
1844
+ | `color` | — | Fill color, one per set (a list, or a dict by set name); default palette colors. |
1486
1845
  | `edge_color` | — | Bar outline color; default none. |
1487
- | `edge_width` | 0.0 | Bar outline width. Length. |
1846
+ | `edge_width` | 0.0 | Bar outline width; default 0 (none). Length. |
1488
1847
  | `line_color` | — | Step and outline color; default each set's color. |
1489
- | `line_width` | inherited (0.75) | Step line width. Length. |
1848
+ | `line_width` | inherited (0.5) | Step line width. Length. |
1490
1849
  | `outline` | True | `bar` and `stepfilled` kinds: the outer outline of each set, in `line_color` (dodged bars: each bar's outline). |
1491
- | `alpha` | 'auto' | Opacity; `"auto"`: 0.5 for overlaid sets, else the plot's. |
1850
+ | `fill` | True | Fill: `True` (each set's color), a color, or `False` (none). |
1851
+ | `fill_opacity` | 'auto' | Opacity of the fills, times `opacity` (lines keep `opacity`); `"auto"`: 0.5 for overlaid sets, else 1. |
1492
1852
  | `saturation` | 1.0 | Saturation of the fills. |
1493
1853
  | `value_labels` | False | Value labels on bars. |
1494
1854
  | `value_label_format` | 'auto' | Number format of the value labels. |
1495
1855
  | `name` | — | Legend entry; unset: not in the legend. |
1856
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1496
1857
  | `z` | — | Drawing order (higher on top); default: call order. |
1497
1858
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1498
1859
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1499
1860
  | `text_color` | inherited ('black') | Text color. |
1500
1861
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1501
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1862
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1502
1863
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1503
1864
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1504
1865
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1866
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1867
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1505
1868
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1506
1869
  | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1507
1870
  | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
@@ -1518,7 +1881,7 @@ Groups: `Stroke` (`edge_`), `Stroke` (`line_`), `Font`, `NumberFormat`.
1518
1881
  pl.Kde(values, plot=None, **settings)
1519
1882
  ```
1520
1883
 
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`.
1884
+ A Gaussian kernel density of each set on a common grid of `points` points, extending `cut` bandwidths past the data (within `range`); dates draw on a time axis. `fill` fills under each curve (`True`, or a color; at `fill_opacity`, 0.25). `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. A set without a bandwidth (no values, one, all equal) or a `range` outside the data has no curve (NaN densities), with a warning. `kde.stats`: `grid`, `densities`, `bandwidths`.
1522
1885
 
1523
1886
  <!-- settings:Kde -->
1524
1887
  | Setting | Default | Meaning |
@@ -1529,24 +1892,27 @@ A Gaussian kernel density of each set on a common grid of `points` points, exten
1529
1892
  | `range` | — | Limits of the curve (within the data plus `cut`); default none. |
1530
1893
  | `points` | 512 | Number of points of the curve. |
1531
1894
  | `cumulative` | False | Plot the cumulative distribution. |
1532
- | `fill` | False | Fill under the curve: an opacity of its color, `True` (0.25), a color, or `False` (stacked curves: 0.25). |
1895
+ | `fill` | False | Fill under the curve: `True` (its color), a color, or `False` (stacked curves are filled anyway). |
1896
+ | `fill_opacity` | 0.25 | Opacity of the fill (0–1). |
1533
1897
  | `weights` | — | A weight per value (per set for several sets). |
1534
1898
  | `orientation` | 'vertical' | `vertical` (values along x) or `horizontal`. |
1535
1899
  | `stack` | False | Stack the sets (seaborn's `multiple="stack"`). |
1536
- | `color` | — | Color, or one per set; default palette colors. |
1537
- | `line_width` | inherited (0.75) | Line width. Length. |
1900
+ | `color` | — | Color, one per set (a list, or a dict by set name); default palette colors. |
1901
+ | `line_width` | inherited (0.5) | Line width. Length. |
1538
1902
  | `line_style` | 'solid' | Line style. Length. |
1539
1903
  | `name` | — | Legend entry; unset: not in the legend. |
1540
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1904
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1541
1905
  | `z` | — | Drawing order (higher on top); default: call order. |
1542
1906
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1543
1907
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1544
1908
  | `text_color` | inherited ('black') | Text color. |
1545
1909
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1546
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1910
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1547
1911
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1548
1912
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1549
1913
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1914
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1915
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1550
1916
 
1551
1917
  Groups: `FillStyle`, `Stroke`, `Font`.
1552
1918
  <!-- /settings -->
@@ -1561,8 +1927,9 @@ Density contours of points (seaborn's `kdeplot(x=, y=)`): the 2-D Gaussian densi
1561
1927
  (bandwidth as [`Density`](#point-density): scipy's covariance times Scott's factor, or
1562
1928
  Silverman's, a number or a matrix, times `adjust`) on a `points` × `points` grid over
1563
1929
  the data plus `cut` bandwidths, in axis positions (log axes in log space). With a number
1564
- of `levels`, contour k of n encloses an equal share of the mass, from 1 − `thresh` (the
1565
- outermost) up; a list gives density values. Unfilled lines take the next palette color,
1930
+ n of `levels`, level k (0 … n − 1) encloses 1 − p of the mass, p = `thresh` + (1 −
1931
+ `thresh`)·k/(n − 1): the outermost 1 − `thresh`, the last at the density's maximum; a
1932
+ list gives density values. Unfilled lines take the next palette color,
1566
1933
  or `palette` (one color or colors per level), unless `color_map` is set; `fill=True`
1567
1934
  colors the bands through
1568
1935
  `color_map`, with the top band up to the maximum. Drawn by the contour code (lines,
@@ -1571,7 +1938,7 @@ labels, colorbar).
1571
1938
  <!-- settings:Kde2d -->
1572
1939
  | Setting | Default | Meaning |
1573
1940
  |---|---|---|
1574
- | `levels` | 10 | A number of iso-proportion levels (contour k of n encloses k/n of the mass, above `thresh`), or density values. |
1941
+ | `levels` | 10 | A number n of iso-proportion levels: level k (0 … n − 1) encloses 1 − p of the mass, p = `thresh` + (1 − `thresh`)·k/(n − 1) (the outermost 1 − `thresh`, the last at the density's maximum); or density values. |
1575
1942
  | `thresh` | 0.05 | Lowest iso-proportion: the outermost contour encloses 1 − `thresh` of the mass. |
1576
1943
  | `bandwidth` | 'scott' | `"scott"`, `"silverman"`, a number or a 2 × 2 matrix, as `Density`. |
1577
1944
  | `adjust` | 1.0 | Factor of the bandwidth. |
@@ -1586,7 +1953,7 @@ labels, colorbar).
1586
1953
  pl.Ecdf(values, plot=None, **settings)
1587
1954
  ```
1588
1955
 
1589
- A step line through the sorted values of each set: `stat` `proportion`, `count` or `percent`; `complementary` plots 1 − F.
1956
+ A step line through the sorted values of each set: `stat` `proportion`, `count` or `percent`; `complementary` plots 1 − F. `color`: one, a list (one per set) or a dict by set name.
1590
1957
 
1591
1958
  <!-- settings:Ecdf -->
1592
1959
  | Setting | Default | Meaning |
@@ -1595,20 +1962,22 @@ A step line through the sorted values of each set: `stat` `proportion`, `count`
1595
1962
  | `stat` | 'proportion' | `proportion` (0–1), `count` or `percent`. |
1596
1963
  | `complementary` | False | Plot 1 − F (survival). |
1597
1964
  | `orientation` | 'vertical' | `vertical`: values along x; `horizontal`: along y. |
1598
- | `color` | — | Line color, or one per set; default palette colors. |
1599
- | `line_width` | inherited (0.75) | Line width. Length. |
1965
+ | `color` | — | Line color, one per set (a list, or a dict by set name); default palette colors. |
1966
+ | `line_width` | inherited (0.5) | Line width. Length. |
1600
1967
  | `line_style` | 'solid' | Line style. Length. |
1601
1968
  | `name` | — | Legend entry; unset: not in the legend. |
1602
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
1969
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1603
1970
  | `z` | — | Drawing order (higher on top); default: call order. |
1604
1971
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1605
1972
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1606
1973
  | `text_color` | inherited ('black') | Text color. |
1607
1974
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1608
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
1975
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1609
1976
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1610
1977
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1611
1978
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
1979
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
1980
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1612
1981
 
1613
1982
  Groups: `Stroke`, `Font`.
1614
1983
  <!-- /settings -->
@@ -1619,7 +1988,7 @@ Groups: `Stroke`, `Font`.
1619
1988
  pl.Violin(values, positions=None, plot=None, **settings)
1620
1989
  ```
1621
1990
 
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.
1991
+ `values` as box plots take them. Each violin is the density of its category, mirrored, in the value axis' space (log axes: in log space); `width_scale` gives equal areas (default), areas proportional to the counts, or equal widths. A category of one value (or all equal) is a line at it, with a warning. `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.
1623
1992
 
1624
1993
  <!-- settings:Violin -->
1625
1994
  | Setting | Default | Meaning |
@@ -1629,11 +1998,11 @@ pl.Violin(values, positions=None, plot=None, **settings)
1629
1998
  | `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
1999
  | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1631
2000
  | `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`). |
1633
- | `edge_width` | 0.75 | Outline width. Length. |
2001
+ | `edge_color` | 'series' | Outline and inner color: a color or `"series"` (each violin's own color, at `opacity`). |
2002
+ | `edge_width` | 'var(line_width)' | Outline width. Length. |
1634
2003
  | `saturation` | 1.0 | Saturation of the fills. |
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`. |
2004
+ | `fill` | True | Fill: `True` (each violin's color), a color, or `False`. |
2005
+ | `fill_opacity` | 0.25 | Opacity of the fill, times `opacity` (outlines keep `opacity`). |
1637
2006
  | `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
2007
  | `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. |
1639
2008
  | `bandwidth` | 'scott' | `scott`, `silverman` or a number. |
@@ -1648,15 +2017,18 @@ pl.Violin(values, positions=None, plot=None, **settings)
1648
2017
  | `gap` | '10%' | Fraction of each part of a shared slot left empty. Length; `%`: of each series' part of a shared slot. |
1649
2018
  | `categories` | — | Category names of a list of arrays. |
1650
2019
  | `name` | — | Legend entry; unset: not in the legend. |
2020
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1651
2021
  | `z` | — | Drawing order (higher on top); default: call order. |
1652
2022
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1653
2023
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1654
2024
  | `text_color` | inherited ('black') | Text color. |
1655
2025
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1656
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2026
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1657
2027
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1658
2028
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1659
2029
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2030
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2031
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1660
2032
 
1661
2033
  Groups: `Stroke` (`edge_`), `FillStyle`, `Font`.
1662
2034
  <!-- /settings -->
@@ -1677,8 +2049,9 @@ Points of each category's values: `Strip` spreads them by uniform jitter (± `ji
1677
2049
  | `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. |
1678
2050
  | `color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1679
2051
  | `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. |
2052
+ | `edge_width` | 0.5 | Outline width; 0: no outline. Length. |
2053
+ | `fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
2054
+ | `fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1682
2055
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1683
2056
  | `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
2057
  | `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. |
@@ -1688,7 +2061,7 @@ Points of each category's values: `Strip` spreads them by uniform jitter (± `ji
1688
2061
  | `size_limits` | — | Limits of the series' size axis, as an axis' `limits`; unset: `"auto"`. |
1689
2062
  | `size_scale` | — | Scale of the series' size axis; unset: `linear`. |
1690
2063
  | `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). |
2064
+ | `size_key` | 'key' | With mapped sizes: a key attached to the plot, as a colorbar's (`"key"`), sample rows in the legend (`"legend"`), none (`False`), or the values to show (a list: a key with a marker at each). |
1692
2065
  | `orientation` | 'vertical' | `vertical` (categories on x) or `horizontal`. |
1693
2066
  | `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
2067
  | `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. |
@@ -1698,18 +2071,20 @@ Points of each category's values: `Strip` spreads them by uniform jitter (± `ji
1698
2071
  | `jitter` | '10%' | Half-width of the jitter (`%` of the slot width). Length; `%`: of the slot: one category, or the smallest gap between positions. |
1699
2072
  | `seed` | 0 | Seed of the jitter. |
1700
2073
  | `draw_order` | — | Drawing order: `"density"` (densest drawn last), `"-density"`, or sort keys per point (ascending); default: call order. |
1701
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own; or `"density"` / a `Density`, mapped linearly to `alpha_range`. |
1702
- | `alpha_range` | (0.2, 1.0) | Opacities of the least and most dense points when `alpha` is a density. |
2074
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own; or `"density"` / a `Density`, mapped linearly to `opacity_range`. |
2075
+ | `opacity_range` | (0.2, 1.0) | Opacities of the least and most dense points when `opacity` is a density. |
1703
2076
  | `name` | — | Legend entry; unset: not in the legend. |
1704
2077
  | `z` | — | Drawing order (higher on top); default: call order. |
1705
2078
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1706
2079
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1707
2080
  | `text_color` | inherited ('black') | Text color. |
1708
2081
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1709
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2082
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1710
2083
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1711
2084
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1712
2085
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2086
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2087
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1713
2088
 
1714
2089
  Groups: `Marker`, `Font`.
1715
2090
  <!-- /settings -->
@@ -1720,32 +2095,36 @@ Groups: `Marker`, `Font`.
1720
2095
  pl.Area(x, ys, plot=None, **settings)
1721
2096
  ```
1722
2097
 
1723
- Layers (rows of `ys`, or a dict `{name: values}`, one legend entry each) stacked on `baseline`: `zero`, `sym`, `wiggle` or `weighted_wiggle` (matplotlib's stackplot baselines). `interpolation` and `missing` as `Fill`.
2098
+ Layers (rows of `ys`, a dict `{name: values}`, one legend entry each, or one flat sequence) stacked on `baseline`: `zero`, `sym`, `wiggle` or `weighted_wiggle` (matplotlib's stackplot baselines). `fill_opacity` is the fills' opacity, `opacity` the whole series'. `interpolation` and `missing` as `Fill`.
1724
2099
 
1725
2100
  <!-- settings:Area -->
1726
2101
  | Setting | Default | Meaning |
1727
2102
  |---|---|---|
1728
2103
  | `baseline` | 'zero' | `zero`, `sym` (symmetric around 0), `wiggle` or `weighted_wiggle` (streamgraphs, as matplotlib's stackplot). |
1729
2104
  | `stack` | True | Stack the layers; `False` overlays them from 0. |
1730
- | `color` | — | A color, or one per layer; default palette colors. |
1731
- | `alpha` | 0.25 | Opacity of the fills. |
2105
+ | `color` | — | A color, one per layer (a list, or a dict by layer name); default palette colors. |
2106
+ | `fill` | True | Fill: `True` (each layer's color), a color, or `False`. |
2107
+ | `fill_opacity` | 0.25 | Opacity of the fill, times `opacity` (outlines keep `opacity`). |
1732
2108
  | `edge_color` | 'series' | Outline color of each layer's top: a color, `"series"` (each layer's own color) or none. |
1733
2109
  | `edge_width` | 'var(line_width)' | Outline width; default the line width. Length. |
1734
2110
  | `interpolation` | 'linear' | How points are joined: `linear`, `step-pre`, `step-post`, `step-mid`, `monotone` (a curve that never overshoots) or `spline` (centripetal Catmull–Rom). |
1735
2111
  | `missing` | 'break' | Missing values: `break` the line there, or `skip` them and connect their neighbours. |
1736
2112
  | `orientation` | 'vertical' | `vertical` (layers along x) or `horizontal` (along y). |
1737
2113
  | `name` | — | Legend entry; unset: not in the legend. |
2114
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1738
2115
  | `z` | — | Drawing order (higher on top); default: call order. |
1739
2116
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1740
2117
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1741
2118
  | `text_color` | inherited ('black') | Text color. |
1742
2119
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1743
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2120
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1744
2121
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1745
2122
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1746
2123
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2124
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2125
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1747
2126
 
1748
- Groups: `Stroke` (`edge_`), `Font`.
2127
+ Groups: `FillStyle`, `Stroke` (`edge_`), `Font`.
1749
2128
  <!-- /settings -->
1750
2129
 
1751
2130
  ### Errorbar
@@ -1763,32 +2142,35 @@ Error bars on their own (markers only with `marker=`); `y_error_style="band"` fi
1763
2142
  | `marker_size` | 4.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1764
2143
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1765
2144
  | `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. |
2145
+ | `marker_edge_width` | 0.5 | Outline width; 0: no outline. Length. |
2146
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
2147
+ | `marker_fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1768
2148
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1769
2149
  | `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
2150
  | `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
2151
  | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1772
2152
  | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1773
2153
  | `color` | — | Bar color; default: the next palette color. |
1774
- | `line_width` | inherited (0.75) | Bar width. Length. |
2154
+ | `line_width` | inherited (0.5) | Bar width. Length. |
1775
2155
  | `cap_length` | 4.0 | Cap width (`data`: in data units across the bar); 0: no caps. Length; `d`: data units. |
1776
2156
  | `x_error` | — | Horizontal errors. |
1777
2157
  | `y_error` | — | Vertical errors. |
1778
2158
  | `y_error_style` | 'bars' | `bars`, or `band`: a filled band between the y error ends (points sorted by x). |
1779
- | `band_alpha` | 0.25 | Opacity of a band. |
2159
+ | `band_opacity` | 0.25 | Opacity of a band. |
1780
2160
  | `orientation` | 'vertical' | `vertical` (x along the x axis) or `horizontal` (x along the y axis). |
1781
2161
  | `name` | — | Legend entry; unset: not in the legend. |
1782
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2162
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1783
2163
  | `z` | — | Drawing order (higher on top); default: call order. |
1784
2164
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1785
2165
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1786
2166
  | `text_color` | inherited ('black') | Text color. |
1787
2167
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1788
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2168
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1789
2169
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1790
2170
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1791
2171
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2172
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2173
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1792
2174
 
1793
2175
  Groups: `Marker` (`marker_`), `Font`.
1794
2176
  <!-- /settings -->
@@ -1809,29 +2191,32 @@ Stems from `baseline` to each value with a marker (lollipops), and a baseline li
1809
2191
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1810
2192
  | `marker_edge_color` | — | Outline: as the fill color, or `"auto"` (white around filled markers; hollow ones outlined in their color). |
1811
2193
  | `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. |
2194
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
2195
+ | `marker_fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1813
2196
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1814
2197
  | `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
2198
  | `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
2199
  | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
1817
2200
  | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1818
2201
  | `color` | — | Stem and marker color; default: the next palette color. |
1819
- | `line_width` | inherited (0.75) | Stem width. Length. |
2202
+ | `line_width` | inherited (0.5) | Stem width. Length. |
1820
2203
  | `baseline` | 0.0 | Value the stems start from. |
1821
2204
  | `baseline_color` | '#4d4d4d' | Baseline color; `none`: no baseline. |
1822
- | `baseline_width` | 0.75 | Baseline width. Length. |
2205
+ | `baseline_width` | 0.5 | Baseline width. Length. |
1823
2206
  | `orientation` | 'vertical' | `vertical` stems (values on y) or `horizontal`. |
1824
2207
  | `name` | — | Legend entry; unset: not in the legend. |
1825
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2208
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1826
2209
  | `z` | — | Drawing order (higher on top); default: call order. |
1827
2210
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1828
2211
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1829
2212
  | `text_color` | inherited ('black') | Text color. |
1830
2213
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1831
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2214
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1832
2215
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1833
2216
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1834
2217
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2218
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2219
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1835
2220
 
1836
2221
  Groups: `Marker` (`marker_`), `Stroke` (`baseline_`), `Font`.
1837
2222
  <!-- /settings -->
@@ -1842,7 +2227,7 @@ Groups: `Marker` (`marker_`), `Stroke` (`baseline_`), `Font`.
1842
2227
  pl.Regression(x, y, plot=None, **settings)
1843
2228
  ```
1844
2229
 
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.
2230
+ 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. With fewer distinct x values than `order` + 1, the order is lowered (one distinct x: no fit), with a warning. 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.
1846
2231
 
1847
2232
  <!-- settings:Regression -->
1848
2233
  | Setting | Default | Meaning |
@@ -1858,13 +2243,14 @@ A least-squares polynomial of `order` with the confidence band of the mean (Stud
1858
2243
  | `color` | — | Line, band and point color; default the next palette color. |
1859
2244
  | `line_width` | 'calc(1.4 * inherit)' | Line width; default 1.4 × the plot's. Length. |
1860
2245
  | `line_style` | 'solid' | Line style or dash list. Length. |
1861
- | `band_alpha` | 0.2 | Opacity of the band. |
2246
+ | `band_opacity` | 0.2 | Opacity of the band. |
1862
2247
  | `marker` | 'circle' | Marker name, `Path` or path data, or one per point. |
1863
2248
  | `marker_size` | 4.5 | Marker size: the diameter of the circle of equal area, in px; one value or one per point. Length. |
1864
2249
  | `marker_color` | — | Fill: a color, colors per point, numbers per point (mapped through `color_map`) or `"density"`. |
1865
2250
  | `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. |
2251
+ | `marker_edge_width` | 0.5 | Outline width; 0: no outline. Length. |
2252
+ | `marker_fill` | True | `True`: filled with the color; `False`: hollow, outlined in the color. |
2253
+ | `marker_fill_opacity` | 1.0 | Opacity of the fill; below 1 the marker is also outlined in its color. |
1868
2254
  | `size_basis` | 'area' | `area`: shapes of the same size have the same area; `box`: size is the width of the shape's box. |
1869
2255
  | `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
2256
  | `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. |
@@ -1872,16 +2258,18 @@ A least-squares polynomial of `order` with the confidence band of the mean (Stud
1872
2258
  | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
1873
2259
  | `orientation` | 'vertical' | `vertical` (y on x) or `horizontal` (the fit drawn with x along the y axis). |
1874
2260
  | `name` | — | Legend entry; unset: not in the legend. |
1875
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2261
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1876
2262
  | `z` | — | Drawing order (higher on top); default: call order. |
1877
2263
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1878
2264
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1879
2265
  | `text_color` | inherited ('black') | Text color. |
1880
2266
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1881
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2267
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1882
2268
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1883
2269
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1884
2270
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2271
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2272
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1885
2273
 
1886
2274
  Groups: `Stroke`, `Marker` (`marker_`), `Font`.
1887
2275
  <!-- /settings -->
@@ -1892,7 +2280,7 @@ Groups: `Stroke`, `Marker` (`marker_`), `Font`.
1892
2280
  pl.Hist2d(x, y, plot=None, **settings)
1893
2281
  ```
1894
2282
 
1895
- Counts in rectangular bins (even on the axis scales), drawn as a heatmap with the heatmap's settings; bins below `min_count` are transparent; a colorbar source.
2283
+ Counts in rectangular bins (even on the axis scales), drawn as a heatmap with the heatmap's settings; bins below `min_count` are transparent; `stat="density"` per unit area of the axes' space; a colorbar source.
1896
2284
 
1897
2285
  <!-- settings:Hist2d -->
1898
2286
  | Setting | Default | Meaning |
@@ -1932,16 +2320,18 @@ the axes are not counted. Colored by `cmap`; a colorbar source.
1932
2320
  | `edge_width` | 0.0 | Outline width. Length. |
1933
2321
  | `colorbar` | False | Attach a colorbar to the plot. |
1934
2322
  | `name` | — | Legend entry; unset: not in the legend. |
1935
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
2323
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
1936
2324
  | `z` | — | Drawing order (higher on top); default: call order. |
1937
2325
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
1938
2326
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1939
2327
  | `text_color` | inherited ('black') | Text color. |
1940
2328
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1941
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2329
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1942
2330
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1943
2331
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1944
2332
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2333
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2334
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1945
2335
 
1946
2336
  Groups: `Stroke` (`edge_`), `Font`.
1947
2337
  <!-- /settings -->
@@ -1958,7 +2348,8 @@ Iso-lines (`lines`) and filled bands (`fill`) of a grid at nodes `x`/`y`. `level
1958
2348
  | Setting | Default | Meaning |
1959
2349
  |---|---|---|
1960
2350
  | `levels` | 10 | A number of levels (nice values over the data) or the level values. |
1961
- | `fill` | False | Fill the bands between levels: `True`, an opacity (0–1, times `alpha`), or `False`. |
2351
+ | `fill` | False | Fill the bands between levels: `True` or `False`. |
2352
+ | `fill_opacity` | 1.0 | Opacity of the bands, times `opacity`. |
1962
2353
  | `lines` | True | Draw the iso-lines. |
1963
2354
  | `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
2355
  | `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. |
@@ -1968,7 +2359,7 @@ Iso-lines (`lines`) and filled bands (`fill`) of a grid at nodes `x`/`y`. `level
1968
2359
  | `line_width` | 'calc(0.6 * inherit)' | Line width; default 0.6 × the plot's. Length. |
1969
2360
  | `line_style` | 'solid' | Line style. Length. |
1970
2361
  | `negative_style` | — | Line style of negative levels drawn with a single color (matplotlib: dashed). |
1971
- | `alpha` | 1.0 | Opacity. |
2362
+ | `opacity` | 1.0 | Opacity. |
1972
2363
  | `value_labels` | False | Write the level values on the lines. |
1973
2364
  | `value_label_format` | 'auto' | Number format of the value labels. |
1974
2365
  | `value_label_font_size` | '0.8em' | Label font size. Length; `%`: of the font size. |
@@ -1979,10 +2370,12 @@ Iso-lines (`lines`) and filled bands (`fill`) of a grid at nodes `x`/`y`. `level
1979
2370
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
1980
2371
  | `text_color` | inherited ('black') | Text color. |
1981
2372
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
1982
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2373
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
1983
2374
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
1984
2375
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
1985
2376
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2377
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2378
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
1986
2379
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
1987
2380
  | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
1988
2381
  | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
@@ -2017,8 +2410,9 @@ Wedges of `values` (a sequence or a dict `{label: value}`) from `start`, on a pl
2017
2410
  | `value_label_format` | 'auto' | Number format of the value labels (percentages: of 100). |
2018
2411
  | `edge_color` | 'series' | Wedge outline color: a color, `"series"` (each wedge's own color) or `none`. |
2019
2412
  | `edge_width` | 1.25 | Wedge outline width. Length. |
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`. |
2413
+ | `opacity` | 1.0 | Opacity. |
2414
+ | `fill` | True | Wedge fill: `True` (each wedge's color), a color, or `False`. |
2415
+ | `fill_opacity` | 0.25 | Opacity of the fills, times `opacity` (outlines keep `opacity`). |
2022
2416
  | `seam_color` | 'white' | The edges neighbouring wedges share, in this color; `none`: both outlines as drawn. |
2023
2417
  | `name` | — | Legend entry; unset: not in the legend. |
2024
2418
  | `z` | — | Drawing order (higher on top); default: call order. |
@@ -2026,10 +2420,12 @@ Wedges of `values` (a sequence or a dict `{label: value}`) from `start`, on a pl
2026
2420
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
2027
2421
  | `text_color` | inherited ('black') | Text color. |
2028
2422
  | `font_size` | inherited (11.0) | Base font size. Length; `%`: of the parent's font size. |
2029
- | `font_family` | inherited ('SF Pro, Inter, Helvetica, Arial, sans-serif') | Font family. |
2423
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
2030
2424
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2031
2425
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2032
2426
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
2427
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
2428
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
2033
2429
  | `decimal_separator` | inherited ('.') | Decimal separator of numbers (`"."`). |
2034
2430
  | `thousands_separator` | inherited ('') | Thousands separator (`""`: none). |
2035
2431
  | `minus` | inherited ('hyphen') | `hyphen` (`-`) or `minus` (U+2212, from an installed font). |
@@ -2054,7 +2450,7 @@ h.color_axis # the series' own color axis
2054
2450
  ca = fig.color_axis(color_map="magma", limits="0/max") # a shared one
2055
2451
  p.heatmap(v, color_axis=ca)
2056
2452
  q.scatter(x, y, c=z, color_axis=ca)
2057
- fig.colorbar(ca, id=5, label="energy")
2453
+ fig.colorbar_area(ca, id=5, label="energy")
2058
2454
  fig = pl.Figure(cols=3, share_color="row") # each row's plots: one color axis
2059
2455
  fig = pl.Figure(cols=3, share_size="all") # one size axis, one size key
2060
2456
  ```
@@ -2080,12 +2476,16 @@ fig = pl.Figure(cols=3, share_size="all") # one size axis, one size ke
2080
2476
  color this way (`"all"` by default).
2081
2477
  * **`share_size`** does the same for the own size axes: limits over all the group's
2082
2478
  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"`).
2479
+ group, beside its plots as a shared colorbar ([size keys](#size-keys); in the
2480
+ [legend](#legend) with `size_key="legend"`, where a figure legend covering every plot
2481
+ of a key takes it). Each series keeps its `size_map`. Facet figures share size too
2482
+ (`"all"`).
2085
2483
  * **Training.** Before the layout, each axis is resolved from the values it maps, by the
2086
2484
  code of x and y axes: the scale's domain, `limits` and quantiles, `include_zero`, no
2087
2485
  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).
2486
+ `under`/`over` colors and missing values its `bad` color (sizes: the `SizeMap`'s);
2487
+ colors outside the scale's domain (0 on a log scale) take the `bad` color too, with a
2488
+ warning naming their count.
2089
2489
 
2090
2490
  Color and size axes have the settings of [axes](#4-axes); these differ:
2091
2491
 
@@ -2106,37 +2506,140 @@ Color and size axes have the settings of [axes](#4-axes); these differ:
2106
2506
  ### Colorbars
2107
2507
 
2108
2508
  ```python
2109
- p.colorbar(source=None, **settings) # attached to a side of the plot
2110
- fig.colorbar(source, id=None, **settings) # in its own grid area
2111
- cb.axis # the color axis shown
2509
+ p.add_colorbar(source=None, side="bottom", **settings) # attached to a side of the plot
2510
+ fig.plot(colorbar=True) # the same, when the plot is made
2511
+ fig.add_colorbar(source=None, plots=None, side="bottom", **settings) # beside plots
2512
+ fig.colorbar_area(source, id=None, **settings) # in its own grid area
2513
+ fig.colorbars # those of add_colorbar
2514
+ cb.axis # the color axis shown
2112
2515
  ```
2113
2516
 
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.
2517
+ `source` is a mapped series (its color axis; default: the plot's last mapped series, or
2518
+ that of the first covered plot with one) or a color axis. A colorbar draws the axis'
2519
+ gradient between its trained limits, with a label: `label`, else the axis' `label`, else
2520
+ the name of the color column or density.
2521
+
2522
+ * **Key** (`style="key"`, the default): one line of the low limit, a short bar with round
2523
+ ends filled with the gradient (`thickness` 4 px, `length` 40 px), the high limit, then
2524
+ the label; `value_gap` (0.6em) between a limit and the bar, `label_gap` (1.2em) before
2525
+ the label. The texts are centered on the bar's middle line, in the axis' tick label font
2526
+ (the label in its label font); `em` is the axis' tick label font size. When the limits
2527
+ clip the data (`extend`), a dot as wide as the bar, in the gradient's under or over
2528
+ color, sits half the thickness past that end (`extend_shape`: `dot`, `block`,
2529
+ `triangle`). `frame` outlines the bar and the dots, following their shapes.
2530
+ * **Values.** `values="limits"`: the axis' limits in its `tick_format` (`"auto"`: rounded
2531
+ to two digits of their range); `"ticks"`: the axis' ticks along the bar instead, under
2532
+ it (right of a vertical one); `"signs"`: a bold − (always U+2212, whatever `minus`) and
2533
+ a bold +; or a pair of texts with markup, `("Low", "High")`, `None` keeping that end's
2534
+ number: `(None, "max")`.
2535
+ * **Vertical** (on the left and right): the high limit above the bar, the low limit below
2536
+ it, the label above everything, horizontal, all centered on the bar.
2537
+ `label_position`: `end` (after the high end; above a vertical key), `start` (before
2538
+ the low end; below a vertical key), `top` (above the key), `side` (under a horizontal
2539
+ key; beside a vertical one, reading upward).
2540
+ * **Bar** (`style="bar"`): a long bar (`length` `100%`, `thickness` 13 px) with the axis'
2541
+ ticks, tick labels and label beside it, for many ticks (log scales, diverging maps).
2542
+ `values`, the gaps and `label_position` are a key's.
2543
+ * **Attached.** A band of the plot's box on its `side` (default `bottom`;
2544
+ `orientation="auto"`: horizontal on top and bottom, vertical on the left and right),
2545
+ placed along the side by `align` (default `center`; `start` is the left or top end, as
2546
+ for figure legends). On one side, from the axes outward: an outside legend, the
2547
+ colorbars (by `order`, else in creation order), the titles. A key longer than its axes
2548
+ side passes its ends, and the margins there grow.
2549
+ * **Lanes.** `fig.add_colorbar` puts a colorbar beside a set of plots (plots or their
2550
+ series; default every plot) in the lanes of [figure titles](#figure-title) and
2551
+ [legends](#figure-legends), with their rules (the plots' grid rectangle, nesting, shared
2552
+ lanes for disjoint spans, creation order, `order`); over the same plots, a legend is
2553
+ nearer the plots, then a colorbar, then a title. `align` (default `center`) places it
2554
+ within the axes of its plots. A `%` `length` is of that span, and a key then fills
2555
+ that part of it (`length="100%"`: the bar takes what the texts leave of the span). The
2556
+ covered plots' attached colorbars of the same axis are left out.
2557
+ * **Shared color axes.** When plots sharing a color axis have attached colorbars of it,
2558
+ one colorbar in the lanes replaces them: per group of `share_color`, on the right of a
2559
+ row or of the figure, at the bottom of a column; then per axis that the attached
2560
+ colorbars of two plots or more show (`fig.color_axis()`), at the bottom of a column,
2561
+ else on the right. It takes the settings of the first one but its place. An attached
2562
+ colorbar whose `side` is set stays, as do those of plots that are not a grid
2563
+ rectangle.
2564
+ * **Own area.** `fig.colorbar_area(source, id=…)` is vertical in its grid area (`orientation`):
2565
+ a key placed along it by `align`, a bar running along the neighbouring axes
2566
+ (`align="axes"`) or boxes (`"borders"`).
2567
+ * `p.save()` (one plot alone) leaves out figure colorbars: the plot's attached colorbars
2568
+ show again.
2569
+
2570
+ Axis settings given to a colorbar go to its axis:
2571
+ `p.add_colorbar(h, label="z", tick_format="{:.0%}")` sets `h.color_axis`'s tick format.
2121
2572
 
2122
2573
  <!-- settings:Colorbar -->
2123
2574
  | Setting | Default | Meaning |
2124
2575
  |---|---|---|
2125
- | `position` | 'right' | Side of the plot an attached bar takes. |
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. |
2576
+ | `side` | 'bottom' | Side of the plot (or of the plots) it sits on. |
2577
+ | `align` | 'center' | Place along its side: `start` (left, or top), `center`, `end` (right, or bottom), or an end by name: `left`, `right` on top and bottom, `top`, `bottom` on the left and right. |
2578
+ | `order` | — | Place among the colorbars of its side: lower is nearer the axes; unset: creation order. |
2579
+ | `style` | 'key' | `key`: one line of the limits around a short bar with round ends, then the label; `bar`: a long bar with the axis' ticks. |
2580
+ | `orientation` | 'auto' | Direction; `"auto"`: horizontal on top and bottom, vertical on the left and right and in an area of its own. |
2581
+ | `thickness` | 'auto' | Bar thickness; `"auto"`: 4 px on a key, 13 px on a bar. Length; `%`: of the span along a key, the axes side across a bar. |
2582
+ | `length` | 'auto' | Bar length; `"auto"`: 40 px on a key, `100%` on a bar. A key given in `%` fills that part of the span with its texts and bar. Length; `%`: of the span along the colorbar (the axes side of an attached one). |
2583
+ | `values` | 'limits' | A key's end texts: `limits` (the axis' limits in its `tick_format`), `ticks` (the axis' ticks along the bar, lengthened to show at least two), `signs` (a bold − and +) or a pair of texts (`None`: that end's number). |
2584
+ | `value_gap` | '0.6em' | Gap between a key's end texts and its bar (and above or below a label on top or under it). Length; `%`: of the font size. |
2585
+ | `label_gap` | '1.2em' | Gap between a key's texts and its label, along the key. Length; `%`: of the font size. |
2586
+ | `label_position` | 'end' | A key's label: after the high end (`end`; above a vertical key), before the low end (`start`; below a vertical key), beside the bar (`side`: under a horizontal key, rotated right of a vertical one) or above the key (`top`). |
2587
+ | `pad` | 'auto' | Gap between the axes and an attached colorbar; `"auto"`: 0.8em on a key, 11 px on a bar. Length; `%`: of the axes side across the colorbar. |
2588
+ | `label` | — | Label: a string or rich content; default: the axis' `label`, else the name of the color column or density. |
2131
2589
  | `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. |
2133
- | `frame` | False | Outline the bar. |
2590
+ | `extend_shape` | 'auto' | `dot`: a dot past the key's end; `block`: a separate block at the end (within a bar's length); `triangle`: a triangle past the end; `"auto"`: `dot` on a key, `block` on a bar. |
2591
+ | `frame` | False | Outline the bar (and its ends), following its shape. |
2592
+ | `count` | 3 | A size key's markers below its high limit (`values="limits"`). |
2593
+ | `marker_gap` | '0.4em' | Gap between a size key's markers (edge to edge). Length; `%`: of the font size. |
2134
2594
  | `frame_color` | '#666666' | Outline color. |
2135
2595
  | `frame_width` | 0.5 | Outline width. Length. |
2136
2596
 
2137
2597
  Groups: `Stroke` (`frame_`).
2138
2598
  <!-- /settings -->
2139
2599
 
2600
+ Figure colorbars (`fig.add_colorbar`) have the settings of colorbars, and:
2601
+
2602
+ <!-- settings:FigureColorbar -->
2603
+ | Setting | Default | Meaning |
2604
+ |---|---|---|
2605
+ | `order` | — | Place in its side's lanes, as figure titles' `order`: lower is nearer the plots. |
2606
+ | `pad` | 'auto' | Gap between the colorbar and the plots; `"auto"`: 0.8em on a key, 11 px on a bar. Length. |
2607
+ <!-- /settings -->
2608
+
2609
+ ### Size keys
2610
+
2611
+ ```python
2612
+ p.scatter(x, y, size=w, size_map=(0, 12)) # a size key under the plot
2613
+ p.add_colorbar(s.size_axis, side="right", count=3) # a size key placed by hand
2614
+ s.set(size_key=[10, 50, 100]) # a marker at each value, labelled
2615
+ ```
2616
+
2617
+ A colorbar of a size axis is a size key: a key whose bar is sample markers of increasing
2618
+ size, `0% · • ● 100% Expressing`. Every series mapping sizes has one by default
2619
+ (`size_key="key"`), attached to its plot under the axes, after the plot's colorbars; a
2620
+ colorbar of the plot showing the same size axis, or a `fig.size_legend` area, replaces
2621
+ it.
2622
+
2623
+ * **Markers.** `count` (3) markers at values evenly spaced below the high limit (in the
2624
+ scale's terms), the high limit's own marker left out; when the low limit's size is
2625
+ zero, the first marker is the next value (at 0–1: ¼, ½, ¾).
2626
+ `marker_gap` (0.4em) between their edges; the line is as tall as the largest. The
2627
+ series' marker shape, in grey, or the series' color when one series of one color uses
2628
+ the axis. Vertical (on the left and right): largest at the top.
2629
+ * **Values.** The limits at the ends in the axis' `tick_format` (`"percent"` for
2630
+ fractions); `values="ticks"`, or a series' `size_key` list: a marker at each value
2631
+ (the axis' ticks, else 3–5 nice numbers), its value under it (right of a vertical
2632
+ key).
2633
+ * **Label**: `label`, else the axis' `label`, else the `size` column name.
2634
+ * **One line.** On top or bottom, a horizontal key joins the line of the keys before it
2635
+ on that side when the line still fits the axes width, `2 × label_gap` apart, middle
2636
+ lines aligned: a dot plot's color and size keys side by side.
2637
+ * **Shared.** As colorbars: plots sharing a size axis (`share_size`, or one
2638
+ `fig.size_axis()` in two plots or more) get one key beside them, in the lanes.
2639
+ * The other settings are a key's (`side`, `align`, `order`, `pad`, `value_gap`,
2640
+ `label_gap`, `label_position`); `style`, `thickness`, `length` and `extend` do not
2641
+ apply.
2642
+
2140
2643
  ## 7. Colors, maps and markers
2141
2644
 
2142
2645
  ### Colors and palette
@@ -2152,8 +2655,8 @@ that take a palette color.
2152
2655
 
2153
2656
  ```python
2154
2657
  pl.Palette(colors="tab10_custom", name=None) # a name, colors, a Palette or n -> colors
2155
- pl.register_palette(name, palette) # a Palette, colors or a function
2156
- pl.palette_names()
2658
+ pl.registry.palettes.add(name, palette) # a Palette, colors or a function
2659
+ pl.registry.palettes.names() pl.registry.palettes.get(name) # a Palette
2157
2660
  ```
2158
2661
 
2159
2662
  | `Palette` | |
@@ -2190,8 +2693,8 @@ parts: `palette=pl.ColorMap("viridis").to_palette(5)` for ordered categories.
2190
2693
  ```python
2191
2694
  pl.ColorMap(colors="rainbow_llhh", positions=None, under=None, over=None, bad=None,
2192
2695
  space=None, name=None, interpolation=None, widen_colors=1, widen_sides=1.0)
2193
- pl.register_color_map(name, color_map)
2194
- pl.color_map_names()
2696
+ pl.registry.color_maps.add(name, color_map)
2697
+ pl.registry.color_maps.names() pl.registry.color_maps.get(name) # a ColorMap ("_r": reversed)
2195
2698
  ```
2196
2699
 
2197
2700
  | Member | |
@@ -2294,8 +2797,8 @@ on the axis positions (log axes in log space); NaN points get NaN. `normalize`:
2294
2797
  under automatic limits. `method`: `"exact"` (the sum over all points, multithreaded in
2295
2798
  C, equal to scipy's), `"grid"` (binned, blurred and read back, about 1e-4 relative) or
2296
2799
  `"auto"` (exact up to 20,000 points). A `Density` (or `"density"`) is accepted by
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
2800
+ `color`, `edge_color`, `size` (through the size axis, default `SizeMap()`), `opacity`
2801
+ (mapped linearly to `opacity_range`, default (0.2, 1)) and `draw_order`, and by `marker_color` and
2299
2802
  `marker_edge_color` of Line (one line), Errorbar, Stem and Regression; one object computes each
2300
2803
  series' own density, cached until a setting changes, and exposed as
2301
2804
  `series.stats["density"]`. The colorbar label defaults to `"density"`.
@@ -2352,35 +2855,59 @@ Inherited settings (figure → plot → axis; series → its color axis):
2352
2855
  | `plus` | 0.51 |
2353
2856
  | `cross` | 0.5754 |
2354
2857
 
2355
- Aliases: `triangle`, `o`, `s`, `d`, `^`, `v`, `<`, `>`, `+`, `x`. A `vec_io.Path` or SVG
2356
- path data in a unit box centred on the origin also works. `pl.register_marker(name, path)`
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.
2858
+ Shorthands: `triangle`, `o`, `s`, `d`, `^`, `v`, `<`, `>`, `+`, `x`
2859
+ ([shorthands](#shorthands)). A `vec_io.Path` or SVG path data in a unit box centred on the
2860
+ origin also works. `pl.registry.markers.add(name, path)` adds a shape (its area measured
2861
+ from the outline), `pl.registry.markers.get(name)` returns its path; `plot_io.markers.resolve(name)` returns
2862
+ its unit path for vec_io's `draw_markers` and its area; `plot_io.markers.marker_area(name)`
2863
+ the area.
2359
2864
 
2360
2865
  ## 8. Output
2361
2866
 
2362
2867
  ```python
2363
- fig.save(path, **options) # .pdf, .png, .jpg/.jpeg, .jxl, .avif
2364
- fig.to_bytes(format="pdf", **options)
2868
+ fig.save(file, *, region=None, format=None, **options) # .pdf, .eps, .svg, .png, .jpg/.jpeg, .jxl, .avif
2869
+ fig.write(kind, *, region=None, **options) # bytes: "pdf", "eps", "svg", "png", …
2365
2870
  fig.draw(canvas, x=0, y=0) # on any vec_io canvas (its document's fonts); returns (width, height) in px
2366
2871
  fig.size() # (width, height) in px
2367
- p.save(path, …) p.to_bytes(…) p.draw(canvas, …) # one plot alone, at its size in the figure
2872
+ p.save(file, …) p.write(kind, …) p.draw(canvas, …) # one plot alone, at its size in the figure
2368
2873
  ```
2369
2874
 
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:
2875
+ `save` writes to a path or a binary file object, in `format` (`"pdf"`, `"eps"`, `"svg"`,
2876
+ `"png"`, `"jpeg"`/`"jpg"`, `"jxl"`, `"avif"`) or by the path's extension; a path without
2877
+ one of these extensions and no `format` raises `ValueError`, as does a file object without
2878
+ `format`. `region` draws a genome region instead of the x axes' (figures and plots).
2879
+
2880
+ The figure is drawn once on a page of a vec_io document in px; each output is that
2881
+ document written by `vec_io.Document.write` with its options (option objects of
2882
+ `vec_io.options`, or dicts of their fields). plot_io reads `quality`, `dpi`,
2883
+ `default_dpi`, `background`, `simplify` and `fonts` (below) and passes the others; an option
2884
+ of another format (`font_hinting` for PNG) or an unknown one raises vec_io's `OptionError`
2885
+ (a `ValueError`). vec_io's `view` and `pages` are refused: a figure's size is its own
2886
+ (`width`, `height`, `margin`).
2372
2887
 
2373
2888
  | Options | Of |
2374
2889
  |---|---|
2375
2890
  | `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
2891
+ | `fonts` | the fonts text is shaped and embedded with ([fonts](#1-conventions)): a vec_io `Fonts` or a dict of its fields (`dirs`, `system`, `downloads`, `db`); default the figure's `fonts` |
2892
+ | `text_as_paths` | text drawn as the outlines of its glyphs: no font embedded, text not selectable (default `False`) |
2893
+ | `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 or SVG lossless. It goes into `images` (PDF, EPS, SVG) or the format's option (`png`, …) unless a dict there sets its own; an option object is used as given |
2894
+ | `compression` | PDF and EPS: `"fast"`, `"balanced"` (default), `"small"`: the encoder's effort for streams and image samples; `None`: uncompressed streams, a readable file. Images: `png={"compression": …}`, … |
2895
+ | `simplify` | the figure's `simplify` for this output: every series without its own follows it ([large data](#large-data)) |
2896
+ | `font_hinting` | PDF and EPS: TrueType hinting kept in embedded subsets (default: left out) |
2897
+ | `flatten` | PDF, EPS and SVG: a vec_io `Flatten` or a dict of its fields (`transparency`, `fallback`, `dpi`, `budget`, `cell`): translucent content drawn as opaque vectors (PDF and SVG: off by default; EPS: always), and what cannot be (an image by default, at `dpi`; a dict's `dpi` takes `"2x"`) |
2898
+ | `dpi` | the output's resolution (dots per inch, or `"2x"`: 192). Images: rendered at it. PDF, EPS and SVG: their images (rasterized series, heatmaps drawn as images) resampled to it, by vec_io's `ImagePolicy(dpi=…)`; not given, they are kept as they are |
2899
+ | `default_dpi` | images without `dpi`: the resolution, for this call (default the figure's `default_dpi`, `"4x"`: four image pixels per px); PDF, EPS and SVG never use it |
2900
+ | `background` | images: the color the figure is drawn on, in place of its `background` (`None`, `"none"`: transparent, white in JPEG); not given, the figure's |
2901
+ | `images` | PDF, EPS and SVG: a vec_io `ImagePolicy` or a dict of its fields: `quality`, `jxl`, and with `dpi` `dpi_mode` (`"down"`, default: images finer than `dpi` resampled down; `"match"`: every image to `dpi`), `dpi_threshold` (images within this factor kept, default 1.5), `dpi_average` (shrinking averages the stored values, `"srgb"`, default, or light, `"linear"`) |
2902
+ | `png`, `jpeg`, `jxl`, `avif` | that image output: a vec_io `PNG`, `JPEG`, `JXL` or `AVIF` or a dict of its fields (`quality`, `compression`, …) |
2903
+
2904
+ EPS output (`.eps`) is vec_io's: one page of PostScript Level 3, its transparency (the
2905
+ opacity of bands, markers, …) flattened into opaque shapes, with an image where it cannot
2906
+ be (dense translucent scatters), and its fonts embedded (Type 42 or CFF). SVG output
2907
+ (`.svg`) is vec_io's SVG writer: paths, `<text>` naming the font families (fonts are not
2908
+ embedded: the reader needs them, or use `text_as_paths=True`), images as PNG or JPEG data;
2909
+ it keeps what the PDF keeps (`simplify`, rasterized series as their images, `quality`). JPEG XL output
2910
+ (`.jxl`) needs libjxl, AVIF output (`.avif`) libavif 1.x. Images inside a
2384
2911
  PDF (rasterized series, heatmaps) are stored losslessly or as JPEG (`quality`), never as
2385
2912
  JPEG XL, so every PDF reader shows them. Fonts are embedded subsets without hinting: a
2386
2913
  typical figure's text adds a few KB per face. A plot
@@ -2390,9 +2917,9 @@ outer tick labels ([layout](#layout)).
2390
2917
 
2391
2918
  PNG quality: by default (`quality="auto"`) PNGs are palette images at quality 90: the plot's
2392
2919
  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.
2920
+ colors cannot render well enough stays lossless. The 28 example PNGs total 2.0 MB this way.
2921
+ Notebook previews (`_repr_png_`) are lossless, at the figure's `default_dpi`, and shown at the
2922
+ figure's size in px.
2396
2923
 
2397
2924
  ### Large data
2398
2925
 
@@ -2409,6 +2936,9 @@ slower). Notebook previews are lossless.
2409
2936
  axes and text stay vectors. Image output draws the group as vectors at its own
2410
2937
  resolution.
2411
2938
 
2939
+ Statistics and rasterization run on vec_io's worker threads: `VEC_IO_THREADS` sets their
2940
+ number (default: the usable CPUs, at most 8; 1: none). Results never depend on it.
2941
+
2412
2942
  Timings (`tools/bench.py`, 8 threads, PDF written):
2413
2943
 
2414
2944
  | Case | Time |
@@ -2482,8 +3012,9 @@ Details:
2482
3012
  `"chr1:500kb-2Mb"`, with `k`, `M`, `G` and an optional `b`, any case, and `,` or `_`
2483
3013
  between thousands), a `(chr, start, end)` tuple or list (0-based, half-open; the same
2484
3014
  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`
3015
+ `Region` (`chr`, `start`, `end`). A region has no strand: a fourth element or a `strand`
3016
+ key is a `ValueError`. A series reads its own `region`, else its x axis'.
3017
+ Data are read when the figure is drawn, for the region drawn: `save`, `write`, `draw`
2487
3018
  and `size` take `region=` to draw another one (it replaces `fig.x_axis`'s region for
2488
3019
  that call).
2489
3020
  * **x axis.** Ticks under every track (but a Hi-C triangle with `direction="down"`), tick
@@ -2534,8 +3065,8 @@ readers, recognised by their `type` attribute (`"bigwig"`, `"bigbed"`, `"bed"`,
2534
3065
  | Data | Methods called |
2535
3066
  |---|---|
2536
3067
  | 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` |
3068
+ | intervals (bigBed, BED, peaks) | `read_entries([(chr, start, end)], columns=…)`: a table, a dict of columns; `columns` from `auto_sql` when the reader has it |
3069
+ | annotation (GTF, GFF3) | `read_entries([(chr, start, end)], model="transcript", gene_type=…, transcript_type=…)`: a table of transcripts: `start`, `end`, `strand`, `transcript_id`, `transcript_name`, `gene_id`, `gene_name`, `cds_start`, `cds_end` (−1 when non-coding); their exons are the table `nested["exons"]` (`start`, `end`), transcript `i`'s at rows `groups[i]:groups[i + 1]`. A reader is told for one by its `tss` method |
2539
3070
  | 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
3071
 
2541
3072
  Results are read as buffers (numpy arrays included) without importing numpy. A path
@@ -2577,21 +3108,24 @@ t.bigwig(pax7_reader, name="Pax7", color="rose")
2577
3108
  | `def_value` | 0.0 | Value of bases no record covers; NaN breaks the line there. |
2578
3109
  | `kind` | 'step' | `step` (a step line along the bins), `line` (through the bin centres) or `bar` (one rectangle per bin). |
2579
3110
  | `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`. |
3111
+ | `fill` | True | Fill (to `fill_to`): `True` (the line color), a color, or `False`. |
3112
+ | `fill_opacity` | 0.2 | Opacity of the fill, times `opacity`. |
2581
3113
  | `color` | — | Line color; default black alone in its track, the next palette color when overlaid. |
2582
3114
  | `transform` | — | A function applied to each value (log, scaling). |
2583
3115
  | `name` | — | Legend entry; unset: not in the legend. |
2584
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
3116
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
2585
3117
  | `z` | — | Drawing order (higher on top); default: call order. |
2586
3118
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
2587
3119
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
2588
- | `line_width` | inherited (0.75) | Line width. Length. |
3120
+ | `line_width` | inherited (0.5) | Line width. Length. |
2589
3121
  | `text_color` | inherited ('black') | Text color. |
2590
3122
  | `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. |
3123
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
2592
3124
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2593
3125
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2594
3126
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
3127
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
3128
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
2595
3129
 
2596
3130
  Groups: `FillStyle`, `Font`.
2597
3131
  <!-- /settings -->
@@ -2608,13 +3142,15 @@ pl.Genes(reader, plot=None, **settings) # Bed with kind="genes", rows expande
2608
3142
  (dicts, or tuples in BED order). Used columns: `chr` (when given, rows of other
2609
3143
  chromosomes are left out), `start`, `end`, `name`, `score`, `strand`, `thickStart`,
2610
3144
  `thickEnd`, `itemRgb` (`reserved` in bigBeds), `blockCount`, `blockSizes`, `blockStarts`.
3145
+ A score that is not a number (`"."`) is missing (the map's `bad` color); an interval
3146
+ ending before it starts, or blocks not matching `blockCount`, are a `ValueError`.
2611
3147
  `genes` draws each BED12 model as a line, thin boxes for UTRs and thick boxes for coding
2612
3148
  exons, chevrons on introns (`strand`), and its name in italics with a strand mark
2613
3149
  (`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
3150
+ with `rows="expand"` packing leaves room for them (their measured width) (`names=False`: none). `name_region` names only the
2615
3151
  features overlapping it (a locus within a wider view), and packing then makes room only
2616
3152
  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
3153
+ `fill` (`False` for outlines only) at `fill_opacity` (0.3), the outline inside the feature's extent: a
2618
3154
  feature narrower than two borders is one line, `line_width` wide. `recolor` snaps the features' colors
2619
3155
  (`itemRgb` ones included) to the named colors (`"blue 0.4"`, §7): `True` takes the
2620
3156
  closest of all shades, a level such as `0.4` the closest color's shade at that level, so
@@ -2633,7 +3169,8 @@ every feature has the same lightness.
2633
3169
  | `name_region` | — | Only features overlapping this region (as `region` takes it) get names; `None`: all. |
2634
3170
  | `strand` | False | Strand chevrons on boxes and introns. |
2635
3171
  | `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). |
3172
+ | `fill` | True | Fill of the features: `True` (their color), a color, or `False` (outlines only). |
3173
+ | `fill_opacity` | 0.3 | Opacity of the fill, times `opacity`. |
2637
3174
  | `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
3175
  | `name_font_size` | '0.85em' | Font size of feature names. Length; `%`: of the font size. |
2639
3176
  | `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. |
@@ -2641,15 +3178,17 @@ every feature has the same lightness.
2641
3178
  | `color_scale` | — | Scale of the series' color axis (`log`, `sqrt`, …); unset: `linear`. |
2642
3179
  | `color_axis` | — | A shared `ColorAxis` (`figure.color_axis(…)`) in place of the series' own: it holds the map, limits and scale. |
2643
3180
  | `name` | — | Legend entry; unset: not in the legend. |
2644
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
3181
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
2645
3182
  | `z` | — | Drawing order (higher on top); default: call order. |
2646
- | `line_width` | inherited (0.75) | Line width. Length. |
3183
+ | `line_width` | inherited (0.5) | Line width. Length. |
2647
3184
  | `text_color` | inherited ('black') | Text color. |
2648
3185
  | `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. |
3186
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
2650
3187
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2651
3188
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2652
3189
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
3190
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
3191
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
2653
3192
 
2654
3193
  Groups: `FillStyle`, `TextStyle` (`name_`), `Font`.
2655
3194
  <!-- /settings -->
@@ -2664,7 +3203,7 @@ Groups: `FillStyle`, `TextStyle` (`name_`), `Font`.
2664
3203
  | `names` | True | Feature names (`name`) left of the features, dropped where they collide. |
2665
3204
  | `strand` | True | Strand chevrons on boxes and introns. |
2666
3205
  | `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). |
3206
+ | `fill_opacity` | 1.0 | Opacity of the fill, times `opacity`. |
2668
3207
 
2669
3208
  Groups: `FillStyle`.
2670
3209
  <!-- /settings -->
@@ -2708,7 +3247,8 @@ the cells of a size (`bins="5kb"`) sit on the file's grid, those past the region
2708
3247
  the track's edges, and `bins=n` reads n cells over the region exactly. Its color axis' limits default
2709
3248
  to quantiles of the cells drawn (`color_limits="q:0.01/q:0.99"`), on a log scale
2710
3249
  (`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`.
3250
+ `nan_color`, transparent), through the figure's `color_map`. A region without a finite
3251
+ positive value draws no cells, its color axis at its default limits.
2712
3252
 
2713
3253
  <!-- settings:HiC -->
2714
3254
  | Setting | Default | Meaning |
@@ -2728,16 +3268,18 @@ to quantiles of the cells drawn (`color_limits="q:0.01/q:0.99"`), on a log scale
2728
3268
  | `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
3269
  | `colorbar` | False | Attach a colorbar to the track. |
2730
3270
  | `name` | — | Legend entry; unset: not in the legend. |
2731
- | `alpha` | inherited (1.0) | Opacity, multiplying the colors' own. |
3271
+ | `opacity` | inherited (1.0) | Opacity, multiplying the colors' own. |
2732
3272
  | `z` | — | Drawing order (higher on top); default: call order. |
2733
3273
  | `rasterize` | inherited (False) | `True` or a dpi: drawn as an image inside the PDF. |
2734
3274
  | `simplify` | inherited ('auto') | `"auto"`, `True`, a dpi or `False`: vec_io's `simplify`. |
2735
3275
  | `text_color` | inherited ('black') | Text color. |
2736
3276
  | `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. |
3277
+ | `font_family` | inherited ('Helvetica, Nimbus Sans, Arial, Liberation Sans, Arimo') | Font family. |
2738
3278
  | `font_stretch` | inherited ('normal') | Font width: `normal`, `condensed`, …, or a percentage (`"87.5%"`); the `wdth` axis of variable fonts. |
2739
3279
  | `font_variations` | inherited (None) | Variable font axes: `{"GRAD": 50}` or `'"GRAD" 50, "wght" 650'`. |
2740
3280
  | `font_optical_sizing` | inherited ('auto') | `auto`: a variable font's `opsz` axis follows the font size; `none`. |
3281
+ | `line_height` | inherited (1.0) | Height of a line of text: a multiple of the font size (`1.2`), a percentage of it, or `normal` (the font's ascent and descent). Text boxes and the gaps around them follow it, with the glyphs centered. |
3282
+ | `markup` | inherited (True) | Read markup in strings (`<b>`, `<i>`, `<sup>`, …: see [conventions](#1-conventions)); `False`: strings stay literal. |
2741
3283
 
2742
3284
  Groups: `Font`.
2743
3285
  <!-- /settings -->
@@ -2768,41 +3310,45 @@ fig = pl.Figure(style="default")
2768
3310
  fig = pl.Figure(style={"base": "default", "font_size": 9, "Axis.grid": True})
2769
3311
  fig = pl.Figure(style={"base": ["house", "talk"], "palette": ["#333", "#c00"]})
2770
3312
 
2771
- pl.register_style("house", {"font_family": "Helvetica", "Legend.frame": True})
3313
+ pl.registry.styles.add("house", {"font_family": "Helvetica", "Legend.frame": True})
2772
3314
  pl.set_style("house") # figures created afterwards
2773
3315
  with pl.use_style({"font_size": 10}): # figures created inside the block
2774
3316
  ...
2775
- pl.styles.names() # registered names
2776
- pl.styles.settings("house") # the resolved dict (base theme included)
3317
+ pl.registry.styles.names() # registered names
3318
+ pl.registry.styles.get("house") # every key of the chain, DEFAULTS included
2777
3319
  ```
2778
3320
 
2779
3321
  * **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),
3322
+ any setting of a class and its subclasses (`Figure`, `FigureTitle`, `MainTitle`, `Plot`, `Title`,
3323
+ `Legend`, `FigureLegend`, `Axis` (plot, color and size axes), `Colorbar`,
3324
+ `FigureColorbar`, every series class, `Series` for all of them, every decoration class,
3325
+ `Decoration` for all of them, `FigureVLine`, `FigureVSpan`, `FigureGroup`, the genome
3326
+ classes),
2783
3327
  or `"Group.member"` for every embedding of a group member (`"Marker.size"`,
2784
3328
  `"Stroke.line_width"`, `"TextStyle.font_weight"`).
2785
3329
  `"Colorbar.<axis setting>"` (`"Colorbar.tick_direction"`, `"Colorbar.tick_color"`, …)
2786
3330
  applies to color axes (the colorbars' axes) only, and `"XAxis.<setting>"`, `"YAxis.<setting>"` to the x or
2787
3331
  y axis of plots only; each wins over `"Axis.<setting>"` there.
2788
3332
  Keys starting with `--` are custom variables (`"--accent": "#c00"`), read by
2789
- `var(--accent)`. Values are checked when the style is registered or set.
2790
- * **`"base"`.** A style name or a list of names, applied left to right (later ones win);
2791
- the dict's own keys are applied over them. Registered styles use the same form.
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.
3333
+ `var(--accent)`; a style has no `"Figure.style"` (its bases are `"base"`) or `vars`
3334
+ key. Values are checked when the style is registered or set.
3335
+ * **`"base"`.** A style name or a list of names (later ones win over earlier ones); the
3336
+ style's own keys win over its bases. Registered styles use the same form.
3337
+ * **Chain.** A figure's style, then its bases (depth first, each once), then `"default"`
3338
+ (`DEFAULTS`). The nearer style wins; within a style, the most specific key wins: a
3339
+ style's `"Marker.size"` beats its base's `"Line.marker_size"`. The order against the
3340
+ object's own values and the parent is the cascade of [conventions](#1-conventions);
3341
+ `explain` names the style a value comes from.
2797
3342
  * **Default.** Without `style`, a figure takes the session style current when it is
2798
- created (`use_style` innermost, else `set_style`), else `"default"`, which adds nothing
2799
- to `DEFAULTS`.
3343
+ created (`use_style` innermost, else `set_style`), else `"default"`. `DEFAULTS` is
3344
+ read-only and `"default"` cannot be re-registered: change defaults with a style
3345
+ (`pl.set_style({"font_family": "Nimbus Sans Narrow"})`).
2800
3346
  * **`scaling`.** A figure setting (default 1, or `"Figure.scaling"` in the style) that
2801
3347
  multiplies every absolute length: font sizes, line widths, marker sizes, tick lengths,
2802
3348
  pads and gaps, from the defaults, the style or set on objects (not the figure size).
2803
3349
  Lengths in `em` follow the scaled font size.
2804
3350
 
2805
- Bundled styles (`pl.styles.names()`), each the defaults of a library expressed in these
3351
+ Bundled styles (`pl.registry.styles.names()`), each the defaults of a library expressed in these
2806
3352
  settings (colors, fonts, grid, axis lines, ticks, legend and title placement, palette,
2807
3353
  color map, default series looks). They never change plot sizes or the minus sign
2808
3354
  (`style={"base": "matplotlib", "minus": "minus"}` gets matplotlib's).
@@ -2810,6 +3356,7 @@ color map, default series looks). They never change plot sizes or the minus sign
2810
3356
  | Style | Follows | Variants |
2811
3357
  |---|---|---|
2812
3358
  | `default` | `DEFAULTS` | — |
3359
+ | `solid` | solid bars, bar histograms, areas and violins, black-outlined boxes, markers without outline; the base of the library styles | — |
2813
3360
  | `matplotlib` | matplotlib ≥ 2.0 defaults (tab10, viridis, four spines, rounded legend frame) | `matplotlib-classic` (1.x: ticks in on all sides, b g r c m y k, jet) |
2814
3361
  | `seaborn` | seaborn darkgrid, notebook context, deep, rocket | `seaborn-darkgrid`, `-whitegrid`, `-dark`, `-white`, `-ticks`; `-paper`, `-talk`, `-poster` (scaling 0.8, 1.5, 2) |
2815
3362
  | `ggplot2` | `theme_grey()`: grey panel, white grid with minor lines, left title, legend outside, `hue` palette | `ggplot2-bw`, `-light`, `-minimal`, `-classic` |
@@ -2834,16 +3381,15 @@ documented default properties. What cannot be expressed: legend titles naming a
2834
3381
  | Exception | Raised for |
2835
3382
  |---|---|
2836
3383
  | `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 |
3384
+ | `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 (`background` for a PDF, `font_hinting` 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; dot grids of two shapes, or two rows for one dot cell |
2838
3385
 
2839
3386
  ## 12. Modules
2840
3387
 
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
3388
+ `pl.__all__` (47 names) is the API. These modules are public too:
3389
+ `plot_io.registry` (`Registry`, and the registries), `plot_io.genome` (`parse_region`, `Region`), `plot_io.markers`
3390
+ (`resolve`, `marker_area`), `plot_io.color.palettes` (`PALETTE`), and the modules of
2845
3391
  the types calls return: `plot_io.facets` (`FacetSet`, `LayerSet`), `plot_io.tables`
2846
- (`SeriesGroup`), `plot_io.colorbar` (`Colorbar`). The others are internal: their names
3392
+ (`SeriesGroup`), `plot_io.colorbar` (`Colorbar`, `FigureColorbar`). The others are internal: their names
2847
3393
  may change in any release.
2848
3394
 
2849
3395
  | Module | Role |
@@ -2853,11 +3399,12 @@ may change in any release.
2853
3399
  | `defaults.py`, `units.py` | `DEFAULTS`; units, `var()`/`calc()`/`inherit`, `%` referents, `explain` traces |
2854
3400
  | `spec.py` | a render's specs (the model resolved once, frozen), layout boxes, palette colors and trained color and size axes |
2855
3401
  | `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`) |
3402
+ | `titles.py`, `markup.py` | the settings plot and figure titles share (`TitleBase`) and a title's text block; markup in strings read into spans |
3403
+ | `rows.py` | row labels in a band left of the plots, groups of rows (`FigureGroup`: letters, labels as figure titles), lines and bands through rows (`FigureVLine`, `FigureVSpan`) |
2857
3404
  | `axis.py`, `scales.py`, `limits.py`, `ticks.py` | axes, scale functions, limits syntax, tick choice and labels |
2858
3405
  | `states.py` | the render's state of each plot: calls, palette, axes and their limits, legend, colorbars |
2859
3406
  | `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`) |
3407
+ | `render.py` | drawing from the geometry; the page of a px document and its outputs (`write`: plot_io's options mapped, `vec_io.Document.write`) |
2861
3408
  | `mapped.py` | color and size axes (`ColorAxis`, `SizeAxis`): own and shared axes of series, their training |
2862
3409
  | `legend.py`, `colorbar.py` | legend (with size keys) and colorbar: measured, placed, drawn |
2863
3410
  | `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` |
@@ -2866,10 +3413,11 @@ may change in any release.
2866
3413
  | `stats.py` | bins, densities, contours, LOWESS and swarm layout, adapted to plot_io's needs |
2867
3414
  | `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`) |
2868
3415
  | `decorations.py` | reference lines, spans, text and annotations |
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) |
3416
+ | `color/` | colors: `values.py` (the `color` validator, named color scales, palette references, alpha channels, 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
3417
  | `sizemaps.py` | `SizeMap`: the diameters of size axes |
2871
3418
  | `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 |
2872
- | `styles/` | style registry and expansion; bundled styles (point libraries in `pt`) |
3419
+ | `styles/` | styles and their expansion; bundled styles (point libraries in `pt`) |
3420
+ | `registry.py` | `pl.registry`: the color map, palette, marker, style and layer registries |
2873
3421
  | `values.py`, `density.py` | values given to `color`/`size` and their rules; `Density` (point density) |
2874
3422
  | `tables.py`, `facets.py` | columns of tables, `group=` splitting (`SeriesGroup`); `facet`, `FacetSet`, `LayerSet` |
2875
3423
  | `sharing.py`, `times.py` | shared axes; dates and times on axes |