plot-io 0.12.0__py3-none-win_arm64.whl

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 (130) hide show
  1. plot_io/__init__.py +73 -0
  2. plot_io/_methods.py +1691 -0
  3. plot_io/_native/__init__.py +199 -0
  4. plot_io/_native/__main__.py +197 -0
  5. plot_io/_native/_api.py +457 -0
  6. plot_io/_native/bin/windows-arm64.dll +0 -0
  7. plot_io/_native/kernels.py +335 -0
  8. plot_io/_native/manifest.json +49 -0
  9. plot_io/axis.py +1347 -0
  10. plot_io/boxes.py +1156 -0
  11. plot_io/canvas.py +389 -0
  12. plot_io/color/__init__.py +3 -0
  13. plot_io/color/data.py +1646 -0
  14. plot_io/color/maps.py +922 -0
  15. plot_io/color/values.py +295 -0
  16. plot_io/color/variants.py +1246 -0
  17. plot_io/colorbar.py +1426 -0
  18. plot_io/columns.py +614 -0
  19. plot_io/decorations.py +920 -0
  20. plot_io/defaults.py +809 -0
  21. plot_io/density.py +113 -0
  22. plot_io/ext.py +68 -0
  23. plot_io/facets.py +240 -0
  24. plot_io/figure.py +788 -0
  25. plot_io/formatters.py +97 -0
  26. plot_io/genome/__init__.py +17 -0
  27. plot_io/genome/adapters.py +356 -0
  28. plot_io/genome/combine.py +123 -0
  29. plot_io/genome/contacts.py +508 -0
  30. plot_io/genome/intervals.py +750 -0
  31. plot_io/genome/lanes.py +191 -0
  32. plot_io/genome/layout.py +184 -0
  33. plot_io/genome/links.py +364 -0
  34. plot_io/genome/pack.py +27 -0
  35. plot_io/genome/readers.py +145 -0
  36. plot_io/genome/regions.py +228 -0
  37. plot_io/genome/scale.py +349 -0
  38. plot_io/genome/series.py +344 -0
  39. plot_io/genome/signal.py +621 -0
  40. plot_io/genome/sites.py +782 -0
  41. plot_io/genome/sources.py +459 -0
  42. plot_io/genome/testing.py +161 -0
  43. plot_io/geometry.py +289 -0
  44. plot_io/groups.py +308 -0
  45. plot_io/guides.py +503 -0
  46. plot_io/helpers/__init__.py +17 -0
  47. plot_io/helpers/clustermap.py +202 -0
  48. plot_io/helpers/dendrogram.py +172 -0
  49. plot_io/helpers/grids.py +304 -0
  50. plot_io/helpers/qq.py +334 -0
  51. plot_io/helpers/raincloud.py +249 -0
  52. plot_io/helpers/tree.py +214 -0
  53. plot_io/helpers/volcano.py +505 -0
  54. plot_io/hints.py +125 -0
  55. plot_io/kernels.py +740 -0
  56. plot_io/labels.py +566 -0
  57. plot_io/layers/__init__.py +100 -0
  58. plot_io/layers/base.py +630 -0
  59. plot_io/layers/context.py +87 -0
  60. plot_io/layers/core.py +446 -0
  61. plot_io/layers/geoms.py +1362 -0
  62. plot_io/layers/grammar.py +586 -0
  63. plot_io/layers/paint.py +614 -0
  64. plot_io/layers/pipeline.py +170 -0
  65. plot_io/layers/positions.py +431 -0
  66. plot_io/layers/stats.py +1088 -0
  67. plot_io/layout.py +1381 -0
  68. plot_io/legend.py +605 -0
  69. plot_io/levels.py +509 -0
  70. plot_io/limits.py +124 -0
  71. plot_io/lines.py +42 -0
  72. plot_io/mapped.py +522 -0
  73. plot_io/markers.py +110 -0
  74. plot_io/markup.py +128 -0
  75. plot_io/numbers.py +354 -0
  76. plot_io/occupancy.py +295 -0
  77. plot_io/plot.py +597 -0
  78. plot_io/presets/__init__.py +51 -0
  79. plot_io/presets/_util.py +153 -0
  80. plot_io/presets/area.py +145 -0
  81. plot_io/presets/bar.py +261 -0
  82. plot_io/presets/box.py +400 -0
  83. plot_io/presets/catpoints.py +177 -0
  84. plot_io/presets/contour.py +353 -0
  85. plot_io/presets/curves.py +30 -0
  86. plot_io/presets/dots.py +355 -0
  87. plot_io/presets/ecdf.py +97 -0
  88. plot_io/presets/errorbar.py +106 -0
  89. plot_io/presets/errors.py +296 -0
  90. plot_io/presets/fill.py +74 -0
  91. plot_io/presets/heatmap.py +322 -0
  92. plot_io/presets/hexbin.py +198 -0
  93. plot_io/presets/hist.py +391 -0
  94. plot_io/presets/hist2d.py +87 -0
  95. plot_io/presets/kde.py +162 -0
  96. plot_io/presets/kde2d.py +147 -0
  97. plot_io/presets/line.py +143 -0
  98. plot_io/presets/pie.py +502 -0
  99. plot_io/presets/regression.py +115 -0
  100. plot_io/presets/scatter.py +194 -0
  101. plot_io/presets/stem.py +100 -0
  102. plot_io/presets/violin.py +323 -0
  103. plot_io/py.typed +0 -0
  104. plot_io/registry.py +82 -0
  105. plot_io/render.py +480 -0
  106. plot_io/rows.py +491 -0
  107. plot_io/scales.py +103 -0
  108. plot_io/seams.py +138 -0
  109. plot_io/settings.py +807 -0
  110. plot_io/shapes.py +66 -0
  111. plot_io/sharing.py +232 -0
  112. plot_io/sizemaps.py +97 -0
  113. plot_io/spec.py +240 -0
  114. plot_io/states.py +216 -0
  115. plot_io/styles/__init__.py +307 -0
  116. plot_io/styles/library.py +397 -0
  117. plot_io/tables.py +138 -0
  118. plot_io/text.py +412 -0
  119. plot_io/ticks.py +400 -0
  120. plot_io/times.py +287 -0
  121. plot_io/titles.py +225 -0
  122. plot_io/transform.py +114 -0
  123. plot_io/types.py +13604 -0
  124. plot_io/units.py +768 -0
  125. plot_io/validators.py +1029 -0
  126. plot_io/values.py +190 -0
  127. plot_io-0.12.0.dist-info/METADATA +215 -0
  128. plot_io-0.12.0.dist-info/RECORD +130 -0
  129. plot_io-0.12.0.dist-info/WHEEL +4 -0
  130. plot_io-0.12.0.dist-info/licenses/LICENSE +28 -0
plot_io/defaults.py ADDED
@@ -0,0 +1,809 @@
1
+ """Every default setting of plot_io, in one place: the default look.
2
+
3
+ ``DEFAULTS`` maps setting names to their default values:
4
+
5
+ * bare names are inherited settings (fonts, colors, line width, number formats, color maps,
6
+ …): a figure passes them to its plots, a plot to its series, unless set lower down;
7
+ * ``"Class.name"`` is the default of one setting of one class. A class without an entry
8
+ of its own uses its base class's (``Fill.opacity`` overrides ``Series.opacity``).
9
+
10
+ * ``"XAxis.name"``/``"YAxis.name"`` is the default of one axis, before ``"Axis.name"``.
11
+
12
+ Values are plain data, parsed by each setting's validator: units (``"1.2em"``, ``"60%"``),
13
+ ``var()`` and ``calc()`` express defaults that depend on other settings (a title's size
14
+ follows the plot's font size). ``DEFAULTS`` is the ``"default"`` style, the last of
15
+ every figure's style chain; it is read-only (styles change the look). ``None``
16
+ means unset (no value, inherit, or off); ``"auto"`` means chosen when drawing by a rule
17
+ the setting's doc states, or that the setting's other defaults parametrize
18
+ (``Axis.padding`` and ``Axis.auto_padding``, ``Axis.max_ticks`` and ``Axis.tick_spacing``).
19
+ """
20
+
21
+ from collections.abc import Iterator, Mapping
22
+ from typing import Any, NoReturn
23
+
24
+ __all__ = ["DEFAULTS", "inherited", "default_of"]
25
+
26
+
27
+ _DEFAULTS: dict[str, Any] = {
28
+ # Inherited settings
29
+ "font_size": 11.0,
30
+ "font_family": ("Helvetica, Nimbus Sans, Nimbus Sans L, TeX Gyre Heros, FreeSans, Arial, "
31
+ "Liberation Sans, Arimo"),
32
+ "font_stretch": "normal",
33
+ "font_variations": None,
34
+ "font_optical_sizing": "auto",
35
+ "line_height": 1.0,
36
+ "markup": True,
37
+ "text_color": "black",
38
+ "line_width": 0.5,
39
+ "opacity": 1.0,
40
+ "rasterize": False,
41
+ "simplify": "auto",
42
+ "qualitative_map": "tab10_custom",
43
+ "sequential_map": "rainbow_lc",
44
+ "diverging_map": "blue_white_red_hc",
45
+ "cyclic_map": "romao",
46
+ "decimal_separator": ".",
47
+ "thousands_separator": "",
48
+ "minus": "hyphen",
49
+ "prefix": "",
50
+ "suffix": "",
51
+ "precision": None,
52
+ "color_variant": "forest",
53
+ "plain_color": None,
54
+ "data": None,
55
+
56
+ # Setting groups: defaults of every embedding of a member (an owner's key comes first)
57
+ "Marker.marker": "circle",
58
+ "Marker.size": 4.5,
59
+ "Marker.color": None,
60
+ "Dendrogram.color": None,
61
+ "Dendrogram.clusters": None,
62
+ "Dendrogram.orientation": "vertical",
63
+ "QQ.dist": "normal",
64
+ "QQ.pvalues": False,
65
+ "QQ.line": "auto",
66
+ "QQ.band": "auto",
67
+ "QQ.band_opacity": 0.2,
68
+ "QQ.edge_color": None,
69
+ "Raincloud.color": None,
70
+ "Raincloud.parts": ("violin", "box", "points"),
71
+ "Raincloud.orientation": "vertical",
72
+ "Raincloud.width": "100%",
73
+ "Raincloud.violin_width": "45%",
74
+ "Raincloud.box_width": "8%",
75
+ "Raincloud.points_offset": "-22%",
76
+ "Raincloud.jitter": "8%",
77
+ "Raincloud.seed": 0,
78
+ "Raincloud.fill_opacity": 0.4,
79
+ "Raincloud.bandwidth": "scott",
80
+ "Raincloud.adjust": 1.0,
81
+ "Raincloud.cut": 2.0,
82
+ "Raincloud.points": 512,
83
+ "Raincloud.whiskers": 1.5,
84
+ "Raincloud.weights": None,
85
+ "Raincloud.median_width": "calc(2 * var(line_width))",
86
+ "Raincloud.marker_size": 3.0,
87
+ "Raincloud.marker_edge_color": None,
88
+ "Raincloud.categories": None,
89
+ "Volcano.fold_change_threshold": 1.0,
90
+ "Volcano.p_threshold": 0.05,
91
+ "Volcano.colors": {"up": "#d6604d", "down": "#4393c3", "n.s.": "#bdbdbd"},
92
+ "Volcano.counts": True,
93
+ "Volcano.thresholds": True,
94
+ "Volcano.threshold_color": "#808080",
95
+ "Volcano.threshold_width": "var(line_width)",
96
+ "Volcano.label": "top",
97
+ "Volcano.label_count": 10,
98
+ "Ma.fold_change_threshold": 1.0,
99
+ "Ma.p_threshold": 0.05,
100
+ "Ma.colors": {"up": "#d6604d", "down": "#4393c3", "n.s.": "#bdbdbd"},
101
+ "Ma.counts": True,
102
+ "Ma.thresholds": True,
103
+ "Ma.threshold_color": "#808080",
104
+ "Ma.threshold_width": "var(line_width)",
105
+ "Ma.label": "top",
106
+ "Ma.label_count": 10,
107
+ "Manhattan.chr_sizes": None,
108
+ "Manhattan.colors": ("#2c5d8f", "#8fb0d3"),
109
+ "Manhattan.threshold": 5e-8,
110
+ "Manhattan.threshold_color": "#808080",
111
+ "Manhattan.threshold_width": "var(line_width)",
112
+ "Manhattan.label": "top",
113
+ "Manhattan.label_count": 10,
114
+ "Marker.edge_color": "auto",
115
+ "Marker.edge_width": 0.5,
116
+ "Marker.fill": True,
117
+ "Marker.fill_opacity": 1.0,
118
+ "Marker.size_basis": "area",
119
+ "Stroke.line_width": 0.5,
120
+ "Stroke.line_style": "solid",
121
+ "Stroke.cap": "butt",
122
+ "Stroke.join": "round",
123
+ "TextStyle.font_size": "1em",
124
+ "TextStyle.font_weight": "normal",
125
+ "TextStyle.font_style": "normal",
126
+ "TextStyle.color": "var(text_color)",
127
+ # Figures: size, arrangement, spacing, output
128
+ "Figure.layout": "auto",
129
+ "Figure.rows": None,
130
+ "Figure.cols": None,
131
+ "Figure.fill_order": "auto",
132
+ "Figure.align": "axes",
133
+ "Figure.widths": None,
134
+ "Figure.heights": None,
135
+ "Figure.width": "150px",
136
+ "Figure.height": "calc(var(width) / var(aspect_ratio))",
137
+ "Figure.aspect_ratio": 5 / 4,
138
+ "Figure.reference": "axes",
139
+ "Figure.spacing": 13.0,
140
+ "Figure.margin": 5.0,
141
+ "Figure.background": "white",
142
+ "Figure.default_dpi": "4x",
143
+ "Figure.quality": "auto",
144
+ "Figure.fonts": None,
145
+ "Figure.share_x": None,
146
+ "Figure.share_color": False,
147
+ "Figure.share_size": False,
148
+ "Figure.share_legend": False,
149
+ "Figure.share_y": None,
150
+ "Figure.share": None,
151
+ "Figure.label_outer": None,
152
+ "Figure.style": None,
153
+ "Figure.scaling": 1.0,
154
+ "Figure.vars": None,
155
+
156
+ # Titles (plot and figure titles)
157
+ "TitleBase.text": None,
158
+ "TitleBase.side": "top",
159
+ "TitleBase.align": "center",
160
+ "TitleBase.over": "axes",
161
+ "TitleBase.rotation": "auto",
162
+ "TitleBase.pad": 5.0,
163
+ "TitleBase.order": None,
164
+ "TitleBase.rule": False,
165
+ "TitleBase.rule_color": "var(color)",
166
+ "TitleBase.rule_width": "var(line_width)",
167
+ "TitleBase.rule_gap": "0.5em",
168
+
169
+ # Figure titles
170
+ "FigureTitle.font_weight": "bold",
171
+ "FigureTitle.pad": "0.5em",
172
+
173
+ # Plots
174
+ "Plot.spines": "bottom left",
175
+ "Plot.data_ratio": None,
176
+ "Plot.background": None,
177
+ "Plot.border_color": None,
178
+ "Plot.clip": True,
179
+ "Plot.axes": True,
180
+ "Plot.share_x": None,
181
+ "Plot.share_y": None,
182
+ "Plot.share": None,
183
+ "Plot.vars": None,
184
+ "Plot.space_above": 0.0,
185
+
186
+ # Figure legends (the other settings: Legend.*)
187
+ "FigureLegend.side": "right",
188
+ "FigureLegend.align": "center",
189
+ "FigureLegend.order": None,
190
+
191
+ # Legends
192
+ "Legend.inside": "auto",
193
+ "Legend.side": None,
194
+ "Legend.align": "auto",
195
+ "Legend.visible": True,
196
+ "Legend.columns": 1,
197
+ "Legend.frame": False,
198
+ "Legend.title": "auto",
199
+ "Legend.background": "white",
200
+ "Legend.frame_color": "#999999",
201
+ "Legend.pad": 5.0,
202
+ "Legend.frame_radius": 0.0,
203
+ "Legend.frame_opacity": 1.0,
204
+ "Legend.glyph_opacity": None,
205
+ "Legend.glyph": "series",
206
+ "Legend.orientation": "auto",
207
+ "Legend.glyph_length": "1.4em",
208
+ "Legend.row_height": "1.35em",
209
+ "Legend.glyph_gap": "0.5em",
210
+ "Legend.column_gap": "1em",
211
+ "Legend.inner_pad": "auto",
212
+ "Legend.title_gap": "0.3em",
213
+
214
+ # Size legends (a size key in its own grid area)
215
+ "SizeLegend.values": None,
216
+ "SizeLegend.title": None,
217
+ "SizeLegend.font_size": None,
218
+
219
+ # Axes
220
+ "Axis.label": None,
221
+ "Axis.label_position": "axis",
222
+ "Axis.region": None,
223
+ "Axis.chr_sizes": None,
224
+ "Axis.scale_bar": False,
225
+ "Axis.unit": "auto",
226
+ "Axis.unit_in": "label",
227
+ "Axis.origin": None,
228
+ "Axis.region_widths": "span",
229
+ "Axis.region_gap": "1em",
230
+ "Axis.scale": None,
231
+ "Axis.linthresh": 1.0,
232
+ "Axis.tz": None,
233
+ "Axis.limits": "auto",
234
+ "ColorAxis.center": None,
235
+ "ColorAxis.color_map": "auto",
236
+ "Axis.padding": "auto",
237
+ "Axis.auto_padding": "5%",
238
+ "Axis.sticky": True,
239
+ "Axis.invert": False,
240
+ "Axis.ticks": None,
241
+ "Axis.tick_labels": None,
242
+ "Axis.minor_ticks": None,
243
+ "Axis.tick_format": "auto",
244
+ "Axis.tick_rotation": "auto",
245
+ "Axis.max_ticks": "auto",
246
+ "Axis.tick_spacing": ("3em", "2em"),
247
+ "Axis.time_tick_spacing": ("5em", "2.5em"),
248
+ "Axis.tick_label_gap": "0.6em",
249
+ "Axis.category_label_spacing": ("1.6em", "1.3em"),
250
+ "Axis.label_min_size": "6pt",
251
+ "Axis.auto_max_ticks": (10, 8),
252
+ "Axis.sci_limits": (-4, 5),
253
+ "Axis.tick_length": 6.0,
254
+ "Axis.minor_tick_length": "60%",
255
+ "Axis.tick_direction": "out",
256
+ "Axis.tick_pad": 5.0,
257
+ "Axis.label_pad": 5.0,
258
+ "Axis.color": "var(text_color)",
259
+ "Axis.line_color": "var(color)",
260
+ "Axis.tick_color": "var(color)",
261
+ "Axis.tick_label_color": "var(color)",
262
+ "Axis.label_color": "var(color)",
263
+ "XAxis.side": "bottom",
264
+ "YAxis.side": "left",
265
+ "Axis.side": "left",
266
+ "Axis.mirror": False,
267
+ "Axis.spine_offset": 0.0,
268
+ "Axis.spine_trim": False,
269
+ "Axis.include_zero": False,
270
+ "Axis.zero_line": False,
271
+ "Axis.zero_line_color": "var(line_color)",
272
+ "Axis.zero_line_width": "var(line_width)",
273
+ "Axis.snap": ("4%", "8%"),
274
+ "Axis.grid": False,
275
+ "Axis.grid_color": "#dddddd",
276
+ "Axis.minor_grid": False,
277
+ "Axis.minor_grid_color": "var(grid_color)",
278
+ "Axis.minor_grid_width": "50%",
279
+ "Axis.minor_grid_style": "var(grid_style)",
280
+ "Axis.visible": True,
281
+
282
+ # Size axes (color axes take the Axis defaults, and colorbar keys)
283
+ "SizeAxis.size_map": None,
284
+
285
+ # Colorbars
286
+ "Colorbar.side": "bottom",
287
+ "Colorbar.inside": None,
288
+ "Colorbar.align": "center",
289
+ "Colorbar.order": None,
290
+ "Colorbar.style": "key",
291
+ "Colorbar.orientation": "auto",
292
+ "Colorbar.thickness": "auto",
293
+ "Colorbar.length": "auto",
294
+ "Colorbar.values": "limits",
295
+ "Colorbar.value_gap": "0.6em",
296
+ "Colorbar.label_gap": "1.2em",
297
+ "Colorbar.label_position": "end",
298
+ "Colorbar.pad": "auto",
299
+ "Colorbar.label": None,
300
+ "Colorbar.extend": "auto",
301
+ "Colorbar.extend_shape": "auto",
302
+ "Colorbar.frame": False,
303
+ "Colorbar.count": 3,
304
+ "Colorbar.marker_gap": "0.4em",
305
+ "Colorbar.frame_color": "#666666",
306
+ "Decoration.name": None,
307
+ "Decoration.opacity": 1.0,
308
+ "Decoration.z": 1.0,
309
+ "Decoration.extend_limits": False,
310
+ "Decoration.clip": True,
311
+ "HLine.color": "#4d4d4d",
312
+ "HLine.min": "0%",
313
+ "HLine.max": "100%",
314
+ "VLine.color": "#4d4d4d",
315
+ "VLine.min": "0%",
316
+ "VLine.max": "100%",
317
+ "AxLine.color": "#4d4d4d",
318
+ "HSpan.color": "#e5e5e5",
319
+ "HSpan.edge_color": None,
320
+ "HSpan.edge_width": 0.0,
321
+ "HSpan.min": "0%",
322
+ "HSpan.max": "100%",
323
+ "HSpan.z": -1.0,
324
+ "VSpan.color": "#e5e5e5",
325
+ "VSpan.edge_color": None,
326
+ "VSpan.edge_width": 0.0,
327
+ "VSpan.min": "0%",
328
+ "VSpan.max": "100%",
329
+ "VSpan.z": -1.0,
330
+ "Text.align": "left",
331
+ "Text.valign": "baseline",
332
+ "Text.rotation": 0.0,
333
+ "Text.coords": "data",
334
+ "Text.clip": False,
335
+ "Annotate.align": "center",
336
+ "Annotate.valign": "center",
337
+ "Annotate.text_coords": "var(coords)",
338
+ "Annotate.arrow": True,
339
+ "Annotate.arrow_style": "->",
340
+ "Annotate.arrow_color": "var(color)",
341
+ "Annotate.head_length": 7.0,
342
+ "Annotate.shrink": 3.0,
343
+ "Bracket.color": "var(text_color)",
344
+ "Bracket.y": None,
345
+ "Bracket.format": "stars",
346
+ "Bracket.stars": (0.05, 0.01, 0.001, 0.0001),
347
+ "Bracket.tip": "0.4em",
348
+ "Bracket.step": "8%",
349
+ "Bracket.gap": "0.15em",
350
+ "Bracket.extend_limits": True,
351
+ "Bracket.clip": False,
352
+
353
+ # Every series
354
+ "Series.name": None,
355
+ "Series.markers": None,
356
+ "Series.line_styles": None,
357
+ "Series.level_order": None,
358
+ "Series.level_missing": "keep",
359
+ "Series.estimate": None,
360
+ "Series.interval": None,
361
+ "Series.color_limits": None,
362
+ "Series.color_scale": None,
363
+ "Series.center": None,
364
+ "Series.color_map": "auto",
365
+ "Series.color_axis": None,
366
+ "Series.colorbar": False,
367
+ "Series.size_limits": None,
368
+ "Series.size_scale": None,
369
+ "Series.size_axis": None,
370
+ "Series.z": None,
371
+ "Series.x_origin": None,
372
+ "Series.x_scale": 1.0,
373
+ "Series.x_extent": None,
374
+ "Series.y_origin": None,
375
+ "Series.y_scale": 1.0,
376
+ "Series.y_extent": None,
377
+
378
+ # Scatter
379
+ "Scatter.size_map": None,
380
+ "Scatter.size_key": "key",
381
+ "Scatter.draw_order": None,
382
+ "Scatter.opacity_range": (0.2, 1.0),
383
+ "Scatter.x_error": None,
384
+ "Scatter.y_error": None,
385
+ "Scatter.orientation": "vertical",
386
+ "Scatter.labels": None,
387
+ "Scatter.label_font_size": "0.9em",
388
+ "Scatter.label_color": None,
389
+ "Scatter.label_reach": "6em",
390
+ "Scatter.label_leaders": True,
391
+
392
+ # Line
393
+ "Line.color": None,
394
+ "Line.interpolation": "linear",
395
+ "Line.missing": "break",
396
+ "Line.orientation": "vertical",
397
+ "Line.x_error": None,
398
+ "Line.y_error": None,
399
+ "Line.show_markers": False,
400
+ "Line.interval_style": "band",
401
+
402
+ # Fill
403
+ "Fill.color": None,
404
+ "Fill.color_below": None,
405
+ "Fill.opacity": "calc(0.3 * inherit)",
406
+ "Fill.edge_color": None,
407
+ "Fill.edge_width": "var(line_width)",
408
+ "Fill.interpolation": "linear",
409
+ "Fill.missing": "break",
410
+ "Fill.orientation": "vertical",
411
+
412
+ # Area
413
+ "Area.orientation": "vertical",
414
+ "Area.baseline": "zero",
415
+ "Area.stack": True,
416
+ "Area.color": None,
417
+ "Area.fill": True,
418
+ "Area.fill_opacity": 0.25,
419
+ "Area.edge_color": "series",
420
+ "Area.edge_width": "var(line_width)",
421
+ "Area.interpolation": "linear",
422
+ "Area.missing": "break",
423
+
424
+ # Error bars
425
+ "Errorbar.orientation": "vertical",
426
+ "Errorbar.marker": None,
427
+ "Errorbar.color": None,
428
+ "Errorbar.cap_length": 4.0,
429
+ "Errorbar.x_error": None,
430
+ "Errorbar.y_error": None,
431
+ "Errorbar.y_error_style": "bars",
432
+ "Errorbar.band_opacity": 0.25,
433
+
434
+ # Stem
435
+ "Stem.marker_size": 5.0,
436
+ "Stem.marker_edge_color": None,
437
+ "Stem.marker_edge_width": 0.0,
438
+ "Stem.color": None,
439
+ "Stem.baseline": 0.0,
440
+ "Stem.baseline_color": "#4d4d4d",
441
+ "Stem.orientation": "vertical",
442
+
443
+ # Regression
444
+ "Regression.orientation": "vertical",
445
+ "Regression.order": 1,
446
+ "Regression.lowess": False,
447
+ "Regression.frac": 0.6666666666666666,
448
+ "Regression.weights": None,
449
+ "Regression.ci": 95.0,
450
+ "Regression.logx": False,
451
+ "Regression.scatter": True,
452
+ "Regression.range": None,
453
+ "Regression.points": 100,
454
+ "Regression.color": None,
455
+ "Regression.band_opacity": 0.2,
456
+
457
+ # Bar
458
+ "Bar.color": None,
459
+ "Bar.edge_color": "series",
460
+ "Bar.edge_width": "var(line_width)",
461
+ "Bar.fill": True,
462
+ "Bar.fill_opacity": 0.25,
463
+ "Bar.seam_color": "white",
464
+ "Bar.width": "80%",
465
+ "Bar.max_width": None,
466
+ "Bar.bottom": 0.0,
467
+ "Bar.orientation": "vertical",
468
+ "Bar.stack": False,
469
+ "Bar.dodge": True,
470
+ "Bar.gap": "15%",
471
+ "Bar.saturation": 1.0,
472
+ "Bar.y_error": None,
473
+ "Bar.error_color": "#333333",
474
+ "Bar.value_labels": False,
475
+ "Bar.value_label_format": "auto",
476
+
477
+ # Histogram
478
+ "Hist.bins": "auto",
479
+ "Hist.range": None,
480
+ "Hist.weights": None,
481
+ "Hist.stat": "count",
482
+ "Hist.cumulative": False,
483
+ "Hist.shape": "stepfilled",
484
+ "Hist.bins_scale": "axis",
485
+ "Hist.orientation": "vertical",
486
+ "Hist.stack": False,
487
+ "Hist.dodge": False,
488
+ "Hist.color": None,
489
+ "Hist.edge_color": None,
490
+ "Hist.edge_width": 0.0,
491
+ "Hist.line_color": None,
492
+ "Hist.outline": True,
493
+ "Hist.fill": True,
494
+ "Hist.fill_opacity": "auto",
495
+ "Hist.saturation": 1.0,
496
+ "Hist.value_labels": False,
497
+ "Hist.value_label_format": "auto",
498
+
499
+ # Density curves
500
+ "Kde.bandwidth": "scott",
501
+ "Kde.adjust": 1.0,
502
+ "Kde.cut": 3.0,
503
+ "Kde.range": None,
504
+ "Kde.points": 512,
505
+ "Kde.cumulative": False,
506
+ "Kde.fill": False,
507
+ "Kde.fill_opacity": 0.25,
508
+ "Kde.weights": None,
509
+ "Kde.orientation": "vertical",
510
+ "Kde.stack": False,
511
+ "Kde.color": None,
512
+
513
+ # ECDF
514
+ "Ecdf.weights": None,
515
+ "Ecdf.stat": "proportion",
516
+ "Ecdf.complementary": False,
517
+ "Ecdf.stack": False,
518
+ "Ecdf.orientation": "vertical",
519
+ "Ecdf.color": None,
520
+
521
+ # Box plots
522
+ "Box.color": None,
523
+ "Box.edge_color": "series",
524
+ "Box.edge_width": "var(line_width)",
525
+ "Box.fill": True,
526
+ "Box.fill_opacity": 0.25,
527
+ "Box.whisker_color": None,
528
+ "Box.whisker_width": "var(edge_width)",
529
+ "Box.median_color": None,
530
+ "Box.median_width": "calc(3 * var(edge_width))",
531
+ "Box.width": "80%",
532
+ "Box.offset": 0.0,
533
+ "Box.max_width": "60%",
534
+ "Box.cap_length": "50%",
535
+ "Box.whiskers": 1.5,
536
+ "Box.weights": None,
537
+ "Box.outliers": True,
538
+ "Box.saturation": 1.0,
539
+ "Box.mean": False,
540
+ "Box.mean_marker": "diamond",
541
+ "Box.mean_color": "white",
542
+ "Box.orientation": "vertical",
543
+ "Box.dodge": True,
544
+ "Box.gap": "15%",
545
+ "Box.categories": None,
546
+ "Box.marker_size": 3.5,
547
+ "Box.marker_edge_color": None,
548
+
549
+ # Violins
550
+ "Violin.color": None,
551
+ "Violin.edge_color": "series",
552
+ "Violin.edge_width": "var(line_width)",
553
+ "Violin.saturation": 1.0,
554
+ "Violin.fill": True,
555
+ "Violin.fill_opacity": 0.25,
556
+ "Violin.width": "80%",
557
+ "Violin.max_width": None,
558
+ "Violin.bandwidth": "scott",
559
+ "Violin.weights": None,
560
+ "Violin.adjust": 1.0,
561
+ "Violin.cut": 2.0,
562
+ "Violin.points": 512,
563
+ "Violin.width_scale": "area",
564
+ "Violin.inner": "box",
565
+ "Violin.split": False,
566
+ "Violin.side": "both",
567
+ "Violin.orientation": "vertical",
568
+ "Violin.dodge": True,
569
+ "Violin.gap": "15%",
570
+ "Violin.categories": None,
571
+ "Strip.size_map": None,
572
+ "Strip.size_key": "key",
573
+ "Strip.orientation": "vertical",
574
+ "Strip.width": "80%",
575
+ "Strip.offset": 0.0,
576
+ "Strip.max_width": None,
577
+ "Strip.dodge": True,
578
+ "Strip.gap": "15%",
579
+ "Strip.categories": None,
580
+ "Strip.jitter": "10%",
581
+ "Strip.seed": 0,
582
+ "Strip.draw_order": None,
583
+ "Strip.opacity_range": (0.2, 1.0),
584
+ "Swarm.size_map": None,
585
+ "Swarm.size_key": "key",
586
+ "Swarm.orientation": "vertical",
587
+ "Swarm.width": "80%",
588
+ "Swarm.offset": 0.0,
589
+ "Swarm.max_width": None,
590
+ "Swarm.dodge": True,
591
+ "Swarm.gap": "15%",
592
+ "Swarm.categories": None,
593
+ "Swarm.draw_order": None,
594
+ "Swarm.opacity_range": (0.2, 1.0),
595
+
596
+ # Heatmaps
597
+ "Heatmap.kind": "image",
598
+ "Heatmap.nan_color": None,
599
+ "Heatmap.origin": "top",
600
+ "Heatmap.value_labels": False,
601
+ "Heatmap.value_label_format": "auto",
602
+ "Heatmap.value_label_font_size": "0.9em",
603
+ # Dot plots
604
+ "Dots.size_map": (0.0, 12.0),
605
+ "Dots.size_limits": "0/max",
606
+ "Dots.size_key": "key",
607
+ "Dots.scale_color": None,
608
+ "Dots.origin": "top",
609
+ "Dots.colorbar": True,
610
+
611
+ # 2-D histograms
612
+ "Hist2d.bins": ("auto", "auto"),
613
+ "Hist2d.range": None,
614
+ "Hist2d.weights": None,
615
+ "Hist2d.stat": "count",
616
+ "Hist2d.min_count": 1.0,
617
+ "Hist2d.origin": "bottom",
618
+
619
+ # Hexagonal bins
620
+ "Hexbin.bins": 30,
621
+ "Hexbin.weights": None,
622
+ "Hexbin.stat": "count",
623
+ "Hexbin.min_count": 1.0,
624
+ "Hexbin.edge_color": None,
625
+ "Hexbin.edge_width": 0.0,
626
+
627
+ # Contours
628
+ "Contour.levels": 10,
629
+ "Contour.fill": False,
630
+ "Contour.fill_opacity": 1.0,
631
+ "Contour.lines": True,
632
+ "Contour.negative_style": None,
633
+ "Contour.opacity": 1.0,
634
+ "Contour.value_labels": False,
635
+ "Contour.value_label_format": "auto",
636
+ "Contour.value_label_font_size": "0.8em",
637
+
638
+ # 2-D densities (contours of a density)
639
+ "Kde2d.thresh": 0.05,
640
+ "Kde2d.bandwidth": "scott",
641
+ "Kde2d.adjust": 1.0,
642
+ "Kde2d.weights": None,
643
+ "Kde2d.cut": 3.0,
644
+ "Kde2d.points": 128,
645
+
646
+ # Pies
647
+ "Pie.names": None,
648
+ "Pie.start": 90.0,
649
+ "Pie.counterclockwise": True,
650
+ "Pie.hole": 0.0,
651
+ "Pie.explode": None,
652
+ "Pie.sort": False,
653
+ "Pie.name_position": "outside",
654
+ "Pie.value_labels": False,
655
+ "Pie.value_label_format": "auto",
656
+ "Pie.label_spacing": "1.25em",
657
+ "Pie.edge_color": "series",
658
+ "Pie.edge_width": 1.25,
659
+ "Pie.opacity": 1.0,
660
+ "Pie.fill": True,
661
+ "Pie.fill_opacity": 0.25,
662
+ "Pie.seam_color": "white",
663
+ # Lines and bands through rows, groups of rows (figure.vline, vspan, group)
664
+ "FigureVLine.color": "#4d4d4d",
665
+ "FigureVLine.line_style": "dashed",
666
+ "FigureVLine.opacity": 1.0,
667
+ "FigureVSpan.color": "#e5e5e5",
668
+ "FigureVSpan.opacity": 1.0,
669
+ "FigureGroup.label": None,
670
+ "FigureGroup.letter": None,
671
+ "FigureGroup.font_size": "1em",
672
+ "FigureGroup.letter_font_size": "1.4em",
673
+ "FigureGroup.letter_weight": "bold",
674
+ "FigureGroup.pad": "0.5em",
675
+ # Genome tracks
676
+ "Track.height": "auto",
677
+ "Track.auto_height": "4.5em",
678
+ "Track.space_above": "auto",
679
+ "Track.auto_space_above": "0.6em",
680
+ "Track.lane_gap": "0.3em",
681
+ "Track.fill_mode": None,
682
+ "GenomeSeries.region": None,
683
+ "BigWig.bins": "0.5px",
684
+ "BigWig.bin_mode": "mean",
685
+ "BigWig.def_value": 0.0,
686
+ "BigWig.kind": "step",
687
+ "BigWig.fill_to": 0.0,
688
+ "BigWig.fill": True,
689
+ "BigWig.fill_opacity": 0.2,
690
+ "BigWig.color": None,
691
+ "BigWig.transform": None,
692
+ "BigWig.lane": "below",
693
+ "BigWig.row_height": "1.2em",
694
+ "Bed.lane": "below",
695
+ "Bed.kind": "boxes",
696
+ "Bed.rows": "collapse",
697
+ "Bed.max_rows": 20,
698
+ "Bed.min_width": 0.75,
699
+ "Bed.color": "black",
700
+ "Bed.names": False,
701
+ "Bed.name_position": "auto",
702
+ "Bed.name_region": None,
703
+ "Bed.recolor": False,
704
+ "Bed.nan_color": "gray",
705
+ "Bed.outline": True,
706
+ "Bed.fill": True,
707
+ "Bed.fill_opacity": 0.3,
708
+ "Bed.strand": False,
709
+ "Bed.row_height": "1.2em",
710
+ "Bed.name_font_size": "0.85em",
711
+ "Genes.kind": "genes",
712
+ "Genes.rows": "expand",
713
+ "Genes.names": True,
714
+ "Genes.strand": True,
715
+ "Genes.outline": False,
716
+ "Genes.fill_opacity": 1.0,
717
+ "Gtf.model": "gene",
718
+ "Gtf.gene_type": None,
719
+ "Gtf.transcript_type": None,
720
+ "HiC.depth": None,
721
+ "HiC.bins": "0.5px",
722
+ "HiC.normalization": "none",
723
+ "HiC.matrix_type": "observed",
724
+ "HiC.color_limits": "q:0.01/q:0.99",
725
+ "HiC.color_scale": "log",
726
+ "HiC.nan_color": None,
727
+ "HiC.direction": "up",
728
+ "HiC.max_height": None,
729
+ "HiC.fit": "clip",
730
+ "HiC.shape": "triangle",
731
+ "HiC.region2": None,
732
+ "Links.lane": "below",
733
+ "Links.direction": "up",
734
+ "Links.color": "black",
735
+ "Links.max_height": "4.5em",
736
+ "Links.outside": "clip",
737
+ "Links.nan_color": "gray",
738
+ # Site matrices (site_heatmap, site_profile)
739
+ "SiteHeatmap.flank": "5kb",
740
+ "SiteHeatmap.bins": 100,
741
+ "SiteHeatmap.anchor": "center",
742
+ "SiteHeatmap.bin_mode": "mean",
743
+ "SiteHeatmap.sort": "mean",
744
+ "SiteHeatmap.row_bins": "auto",
745
+ "SiteHeatmap.nan_color": None,
746
+ "SiteProfile.flank": "5kb",
747
+ "SiteProfile.bins": 100,
748
+ "SiteProfile.anchor": "center",
749
+ "SiteProfile.bin_mode": "mean",
750
+ "SiteProfile.stat": "mean",
751
+ "SiteProfile.band": None,
752
+ "SiteProfile.color": None,
753
+ "SiteProfile.fill_opacity": 0.2,
754
+ }
755
+
756
+
757
+ class _ReadOnly(Mapping[str, Any]):
758
+ """``DEFAULTS``: a read-only view of the default values."""
759
+
760
+ __slots__ = ("_d",)
761
+
762
+ def __init__(self, d: dict[str, Any]) -> None:
763
+ self._d = d
764
+
765
+ def __getitem__(self, key: str) -> Any:
766
+ return self._d[key]
767
+
768
+ def __contains__(self, key: object) -> bool:
769
+ return key in self._d
770
+
771
+ def get(self, key: str, default: Any = None) -> Any:
772
+ return self._d.get(key, default)
773
+
774
+ def __iter__(self) -> Iterator[str]:
775
+ return iter(self._d)
776
+
777
+ def __len__(self) -> int:
778
+ return len(self._d)
779
+
780
+ def __repr__(self) -> str:
781
+ return f"DEFAULTS({self._d!r})"
782
+
783
+ def _refuse(self, *args: Any, **kwargs: Any) -> NoReturn:
784
+ raise TypeError("DEFAULTS is read-only: change settings with a style "
785
+ "(plt.set_style({...}), plt.use_style or plt.registry.styles.add)")
786
+
787
+ __setitem__ = __delitem__ = __ior__ = _refuse
788
+ update = pop = popitem = setdefault = clear = _refuse
789
+
790
+
791
+ DEFAULTS: Mapping[str, Any] = _ReadOnly(_DEFAULTS)
792
+
793
+
794
+ def inherited() -> dict[str, Any]:
795
+ """The inherited settings of ``DEFAULTS`` (bare names), under every style's."""
796
+ return {k: v for k, v in DEFAULTS.items() if "." not in k}
797
+
798
+
799
+ def default_of(setting: Any, key: str) -> Any:
800
+ """``DEFAULTS[key]`` (a key not in ``DEFAULTS``: the setting's declared default), text
801
+ and sequences parsed by ``setting``'s validator. ``ValueError`` when it rejects it."""
802
+ d = DEFAULTS[key] if key in DEFAULTS else setting.default
803
+ if isinstance(d, (str, tuple, list)):
804
+ from .settings import check_value
805
+ try:
806
+ d = check_value(setting, d)
807
+ except ValueError as e:
808
+ raise ValueError(f"default {key}: {e}") from None
809
+ return d