matplotlib-rs 0.0.8__cp315-cp315-win_amd64.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 (352) hide show
  1. docs/releases/0.0.1.md +268 -0
  2. docs/releases/0.0.2.md +69 -0
  3. docs/releases/0.0.3.md +80 -0
  4. docs/releases/0.0.4.md +73 -0
  5. docs/releases/0.0.5.md +24 -0
  6. docs/releases/0.0.6.md +24 -0
  7. docs/releases/0.0.7.md +24 -0
  8. docs/releases/0.0.8.md +16 -0
  9. licenses/LICENSE_CONTOURPY +29 -0
  10. licenses/LICENSE_CYCLER +27 -0
  11. licenses/LICENSE_DATEUTIL +54 -0
  12. licenses/LICENSE_KIWISOLVER +71 -0
  13. licenses/LICENSE_LIBWEBP +56 -0
  14. licenses/LICENSE_MATPLOTLIB +1253 -0
  15. licenses/LICENSE_PYPARSING +20 -0
  16. licenses/LICENSE_QHULL +39 -0
  17. licenses/LICENSE_SIX +18 -0
  18. matplotlib_rs/__init__.py +1683 -0
  19. matplotlib_rs/__main__.py +27 -0
  20. matplotlib_rs/_afm.py +500 -0
  21. matplotlib_rs/_animation_data.py +263 -0
  22. matplotlib_rs/_api/__init__.py +495 -0
  23. matplotlib_rs/_api/deprecation.py +534 -0
  24. matplotlib_rs/_axis_py.py +2991 -0
  25. matplotlib_rs/_blocking_input.py +31 -0
  26. matplotlib_rs/_cm.py +1500 -0
  27. matplotlib_rs/_cm_bivar.py +1289 -0
  28. matplotlib_rs/_cm_listed.py +2848 -0
  29. matplotlib_rs/_cm_multivar.py +167 -0
  30. matplotlib_rs/_color_data.py +1142 -0
  31. matplotlib_rs/_colormap.py +132 -0
  32. matplotlib_rs/_constrained_layout.py +825 -0
  33. matplotlib_rs/_contour.py +108 -0
  34. matplotlib_rs/_doc_cache.py +12214 -0
  35. matplotlib_rs/_docstring.py +142 -0
  36. matplotlib_rs/_enums.py +178 -0
  37. matplotlib_rs/_figure_rs.py +294 -0
  38. matplotlib_rs/_fontconfig_pattern.py +129 -0
  39. matplotlib_rs/_foreign.py +220 -0
  40. matplotlib_rs/_hook.py +94 -0
  41. matplotlib_rs/_image.py +160 -0
  42. matplotlib_rs/_imageio.py +229 -0
  43. matplotlib_rs/_internal_utils.py +65 -0
  44. matplotlib_rs/_kiwi.py +484 -0
  45. matplotlib_rs/_layoutgrid.py +549 -0
  46. matplotlib_rs/_live.py +192 -0
  47. matplotlib_rs/_mathtext.py +3103 -0
  48. matplotlib_rs/_mathtext_data.py +1811 -0
  49. matplotlib_rs/_mplrs.cp315-win_amd64.pyd +0 -0
  50. matplotlib_rs/_path.py +25 -0
  51. matplotlib_rs/_png.py +162 -0
  52. matplotlib_rs/_pylab_helpers.py +137 -0
  53. matplotlib_rs/_qhull.py +66 -0
  54. matplotlib_rs/_rcpush.py +84 -0
  55. matplotlib_rs/_spines_rs.py +108 -0
  56. matplotlib_rs/_style_helpers.py +52 -0
  57. matplotlib_rs/_text_helpers.py +51 -0
  58. matplotlib_rs/_tight_bbox.py +85 -0
  59. matplotlib_rs/_tight_layout.py +302 -0
  60. matplotlib_rs/_tri.py +140 -0
  61. matplotlib_rs/_type1font.py +1228 -0
  62. matplotlib_rs/_vendor/__init__.py +8 -0
  63. matplotlib_rs/_vendor/cycler.py +574 -0
  64. matplotlib_rs/_vendor/dateutil/__init__.py +27 -0
  65. matplotlib_rs/_vendor/dateutil/_common.py +44 -0
  66. matplotlib_rs/_vendor/dateutil/_tzdata_impl.py +148 -0
  67. matplotlib_rs/_vendor/dateutil/_version.py +5 -0
  68. matplotlib_rs/_vendor/dateutil/easter.py +90 -0
  69. matplotlib_rs/_vendor/dateutil/parser/__init__.py +62 -0
  70. matplotlib_rs/_vendor/dateutil/parser/_parser.py +1614 -0
  71. matplotlib_rs/_vendor/dateutil/parser/isoparser.py +417 -0
  72. matplotlib_rs/_vendor/dateutil/relativedelta.py +597 -0
  73. matplotlib_rs/_vendor/dateutil/rrule.py +1765 -0
  74. matplotlib_rs/_vendor/dateutil/tz/__init__.py +61 -0
  75. matplotlib_rs/_vendor/dateutil/tz/_common.py +420 -0
  76. matplotlib_rs/_vendor/dateutil/tz/_factories.py +81 -0
  77. matplotlib_rs/_vendor/dateutil/tz/_tzfile.py +1429 -0
  78. matplotlib_rs/_vendor/dateutil/tz/_tzpath.py +105 -0
  79. matplotlib_rs/_vendor/dateutil/tz/tz.py +1473 -0
  80. matplotlib_rs/_vendor/dateutil/tz/win.py +371 -0
  81. matplotlib_rs/_vendor/dateutil/tzwin.py +3 -0
  82. matplotlib_rs/_vendor/dateutil/utils.py +72 -0
  83. matplotlib_rs/_vendor/dateutil/zoneinfo/__init__.py +234 -0
  84. matplotlib_rs/_vendor/pyparsing/__init__.py +414 -0
  85. matplotlib_rs/_vendor/pyparsing/actions.py +265 -0
  86. matplotlib_rs/_vendor/pyparsing/common.py +571 -0
  87. matplotlib_rs/_vendor/pyparsing/core.py +6973 -0
  88. matplotlib_rs/_vendor/pyparsing/exceptions.py +354 -0
  89. matplotlib_rs/_vendor/pyparsing/helpers.py +1770 -0
  90. matplotlib_rs/_vendor/pyparsing/results.py +929 -0
  91. matplotlib_rs/_vendor/pyparsing/testing.py +399 -0
  92. matplotlib_rs/_vendor/pyparsing/unicode.py +357 -0
  93. matplotlib_rs/_vendor/pyparsing/util.py +515 -0
  94. matplotlib_rs/_vendor/pyparsing/warnings.py +11 -0
  95. matplotlib_rs/_vendor/six.py +1004 -0
  96. matplotlib_rs/animation.py +1843 -0
  97. matplotlib_rs/artist.py +2302 -0
  98. matplotlib_rs/axes/__init__.py +19 -0
  99. matplotlib_rs/axes/_axes.py +9402 -0
  100. matplotlib_rs/axes/_bar.py +185 -0
  101. matplotlib_rs/axes/_base.py +5236 -0
  102. matplotlib_rs/axes/_base_rs.py +727 -0
  103. matplotlib_rs/axes/_boxplot.py +391 -0
  104. matplotlib_rs/axes/_hist.py +99 -0
  105. matplotlib_rs/axes/_secondary_axes.py +357 -0
  106. matplotlib_rs/axis.py +1963 -0
  107. matplotlib_rs/backend_bases.py +3760 -0
  108. matplotlib_rs/backend_managers.py +388 -0
  109. matplotlib_rs/backend_tools.py +1002 -0
  110. matplotlib_rs/backends/__init__.py +6 -0
  111. matplotlib_rs/backends/_backend_pdf_ps.py +451 -0
  112. matplotlib_rs/backends/backend_agg.py +552 -0
  113. matplotlib_rs/backends/backend_mixed.py +123 -0
  114. matplotlib_rs/backends/backend_pdf.py +2711 -0
  115. matplotlib_rs/backends/backend_pgf.py +1031 -0
  116. matplotlib_rs/backends/backend_ps.py +1491 -0
  117. matplotlib_rs/backends/backend_svg.py +1395 -0
  118. matplotlib_rs/backends/backend_template.py +214 -0
  119. matplotlib_rs/backends/registry.py +423 -0
  120. matplotlib_rs/bezier.py +691 -0
  121. matplotlib_rs/category.py +236 -0
  122. matplotlib_rs/cbook.py +2762 -0
  123. matplotlib_rs/cm.py +251 -0
  124. matplotlib_rs/collections.py +2711 -0
  125. matplotlib_rs/colorbar.py +1586 -0
  126. matplotlib_rs/colorizer.py +909 -0
  127. matplotlib_rs/colors.py +4278 -0
  128. matplotlib_rs/container.py +256 -0
  129. matplotlib_rs/contour.py +1756 -0
  130. matplotlib_rs/dates.py +1847 -0
  131. matplotlib_rs/dviread.py +1386 -0
  132. matplotlib_rs/figure.py +3815 -0
  133. matplotlib_rs/font_manager.py +1855 -0
  134. matplotlib_rs/ft2font.py +515 -0
  135. matplotlib_rs/gridspec.py +808 -0
  136. matplotlib_rs/hatch.py +244 -0
  137. matplotlib_rs/image.py +1863 -0
  138. matplotlib_rs/inset.py +291 -0
  139. matplotlib_rs/layout_engine.py +310 -0
  140. matplotlib_rs/legend.py +1480 -0
  141. matplotlib_rs/legend_handler.py +812 -0
  142. matplotlib_rs/lines.py +1886 -0
  143. matplotlib_rs/markers.py +908 -0
  144. matplotlib_rs/mathtext.py +141 -0
  145. matplotlib_rs/mlab.py +959 -0
  146. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf +0 -0
  147. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-BoldOblique.ttf +0 -0
  148. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Oblique.ttf +0 -0
  149. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans.ttf +0 -0
  150. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf +0 -0
  151. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Bold.ttf +0 -0
  152. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-BoldOblique.ttf +0 -0
  153. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Oblique.ttf +0 -0
  154. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono.ttf +0 -0
  155. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Bold.ttf +0 -0
  156. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-BoldItalic.ttf +0 -0
  157. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Italic.ttf +0 -0
  158. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif.ttf +0 -0
  159. matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf +0 -0
  160. matplotlib_rs/mpl-data/fonts/ttf/LICENSE_DEJAVU +99 -0
  161. matplotlib_rs/mpl-data/fonts/ttf/LICENSE_STIX +124 -0
  162. matplotlib_rs/mpl-data/fonts/ttf/LastResortHE-Regular.ttf +0 -0
  163. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneral.ttf +0 -0
  164. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBol.ttf +0 -0
  165. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf +0 -0
  166. matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralItalic.ttf +0 -0
  167. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUni.ttf +0 -0
  168. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBol.ttf +0 -0
  169. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf +0 -0
  170. matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniIta.ttf +0 -0
  171. matplotlib_rs/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf +0 -0
  172. matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf +0 -0
  173. matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf +0 -0
  174. matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf +0 -0
  175. matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf +0 -0
  176. matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf +0 -0
  177. matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf +0 -0
  178. matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf +0 -0
  179. matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf +0 -0
  180. matplotlib_rs/mpl-data/fonts/ttf/cmb10.ttf +0 -0
  181. matplotlib_rs/mpl-data/fonts/ttf/cmex10.ttf +0 -0
  182. matplotlib_rs/mpl-data/fonts/ttf/cmmi10.ttf +0 -0
  183. matplotlib_rs/mpl-data/fonts/ttf/cmr10.ttf +0 -0
  184. matplotlib_rs/mpl-data/fonts/ttf/cmss10.ttf +0 -0
  185. matplotlib_rs/mpl-data/fonts/ttf/cmsy10.ttf +0 -0
  186. matplotlib_rs/mpl-data/fonts/ttf/cmti10.ttf +0 -0
  187. matplotlib_rs/mpl-data/fonts/ttf/cmtt10.ttf +0 -0
  188. matplotlib_rs/mpl-data/images/back-symbolic.svg +46 -0
  189. matplotlib_rs/mpl-data/images/back.pdf +0 -0
  190. matplotlib_rs/mpl-data/images/back.png +0 -0
  191. matplotlib_rs/mpl-data/images/back.svg +46 -0
  192. matplotlib_rs/mpl-data/images/back_large.png +0 -0
  193. matplotlib_rs/mpl-data/images/filesave-symbolic.svg +68 -0
  194. matplotlib_rs/mpl-data/images/filesave.pdf +72 -0
  195. matplotlib_rs/mpl-data/images/filesave.png +0 -0
  196. matplotlib_rs/mpl-data/images/filesave.svg +68 -0
  197. matplotlib_rs/mpl-data/images/filesave_large.png +0 -0
  198. matplotlib_rs/mpl-data/images/forward-symbolic.svg +46 -0
  199. matplotlib_rs/mpl-data/images/forward.pdf +0 -0
  200. matplotlib_rs/mpl-data/images/forward.png +0 -0
  201. matplotlib_rs/mpl-data/images/forward.svg +46 -0
  202. matplotlib_rs/mpl-data/images/forward_large.png +0 -0
  203. matplotlib_rs/mpl-data/images/hand.pdf +0 -0
  204. matplotlib_rs/mpl-data/images/hand.png +0 -0
  205. matplotlib_rs/mpl-data/images/hand.svg +130 -0
  206. matplotlib_rs/mpl-data/images/help-symbolic.svg +52 -0
  207. matplotlib_rs/mpl-data/images/help.pdf +71 -0
  208. matplotlib_rs/mpl-data/images/help.png +0 -0
  209. matplotlib_rs/mpl-data/images/help.svg +52 -0
  210. matplotlib_rs/mpl-data/images/help_large.png +0 -0
  211. matplotlib_rs/mpl-data/images/home-symbolic.svg +59 -0
  212. matplotlib_rs/mpl-data/images/home.pdf +0 -0
  213. matplotlib_rs/mpl-data/images/home.png +0 -0
  214. matplotlib_rs/mpl-data/images/home.svg +59 -0
  215. matplotlib_rs/mpl-data/images/home_large.png +0 -0
  216. matplotlib_rs/mpl-data/images/matplotlib.pdf +0 -0
  217. matplotlib_rs/mpl-data/images/matplotlib.png +0 -0
  218. matplotlib_rs/mpl-data/images/matplotlib.svg +3171 -0
  219. matplotlib_rs/mpl-data/images/matplotlib_large.png +0 -0
  220. matplotlib_rs/mpl-data/images/move-symbolic.svg +73 -0
  221. matplotlib_rs/mpl-data/images/move.pdf +0 -0
  222. matplotlib_rs/mpl-data/images/move.png +0 -0
  223. matplotlib_rs/mpl-data/images/move.svg +73 -0
  224. matplotlib_rs/mpl-data/images/move_large.png +0 -0
  225. matplotlib_rs/mpl-data/images/qt4_editor_options.pdf +0 -0
  226. matplotlib_rs/mpl-data/images/qt4_editor_options.png +0 -0
  227. matplotlib_rs/mpl-data/images/qt4_editor_options.svg +48 -0
  228. matplotlib_rs/mpl-data/images/qt4_editor_options_large.png +0 -0
  229. matplotlib_rs/mpl-data/images/subplots-symbolic.svg +81 -0
  230. matplotlib_rs/mpl-data/images/subplots.pdf +0 -0
  231. matplotlib_rs/mpl-data/images/subplots.png +0 -0
  232. matplotlib_rs/mpl-data/images/subplots.svg +81 -0
  233. matplotlib_rs/mpl-data/images/subplots_large.png +0 -0
  234. matplotlib_rs/mpl-data/images/zoom_to_rect-symbolic.svg +40 -0
  235. matplotlib_rs/mpl-data/images/zoom_to_rect.pdf +69 -0
  236. matplotlib_rs/mpl-data/images/zoom_to_rect.png +0 -0
  237. matplotlib_rs/mpl-data/images/zoom_to_rect.svg +40 -0
  238. matplotlib_rs/mpl-data/images/zoom_to_rect_large.png +0 -0
  239. matplotlib_rs/mpl-data/kpsewhich.lua +4 -0
  240. matplotlib_rs/mpl-data/matplotlibrc +849 -0
  241. matplotlib_rs/mpl-data/plot_directive/plot_directive.css +16 -0
  242. matplotlib_rs/mpl-data/sample_data/Minduka_Present_Blue_Pack.png +0 -0
  243. matplotlib_rs/mpl-data/sample_data/README.txt +2 -0
  244. matplotlib_rs/mpl-data/sample_data/Stocks.csv +526 -0
  245. matplotlib_rs/mpl-data/sample_data/axes_grid/bivariate_normal.npy +0 -0
  246. matplotlib_rs/mpl-data/sample_data/data_x_x2_x3.csv +11 -0
  247. matplotlib_rs/mpl-data/sample_data/eeg.dat +0 -0
  248. matplotlib_rs/mpl-data/sample_data/embedding_in_wx3.xrc +65 -0
  249. matplotlib_rs/mpl-data/sample_data/goog.npz +0 -0
  250. matplotlib_rs/mpl-data/sample_data/grace_hopper.jpg +0 -0
  251. matplotlib_rs/mpl-data/sample_data/jacksboro_fault_dem.npz +0 -0
  252. matplotlib_rs/mpl-data/sample_data/logo2.png +0 -0
  253. matplotlib_rs/mpl-data/sample_data/membrane.dat +0 -0
  254. matplotlib_rs/mpl-data/sample_data/msft.csv +66 -0
  255. matplotlib_rs/mpl-data/sample_data/s1045.ima.gz +0 -0
  256. matplotlib_rs/mpl-data/sample_data/topobathy.npz +0 -0
  257. matplotlib_rs/mpl-data/stylelib/Solarize_Light2.mplstyle +53 -0
  258. matplotlib_rs/mpl-data/stylelib/_classic_test_patch.mplstyle +8 -0
  259. matplotlib_rs/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle +19 -0
  260. matplotlib_rs/mpl-data/stylelib/_mpl-gallery.mplstyle +19 -0
  261. matplotlib_rs/mpl-data/stylelib/bmh.mplstyle +27 -0
  262. matplotlib_rs/mpl-data/stylelib/classic.mplstyle +491 -0
  263. matplotlib_rs/mpl-data/stylelib/dark_background.mplstyle +26 -0
  264. matplotlib_rs/mpl-data/stylelib/fast.mplstyle +11 -0
  265. matplotlib_rs/mpl-data/stylelib/fivethirtyeight.mplstyle +37 -0
  266. matplotlib_rs/mpl-data/stylelib/ggplot.mplstyle +39 -0
  267. matplotlib_rs/mpl-data/stylelib/grayscale.mplstyle +29 -0
  268. matplotlib_rs/mpl-data/stylelib/petroff10.mplstyle +5 -0
  269. matplotlib_rs/mpl-data/stylelib/petroff6.mplstyle +5 -0
  270. matplotlib_rs/mpl-data/stylelib/petroff8.mplstyle +5 -0
  271. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle +3 -0
  272. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle +3 -0
  273. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle +3 -0
  274. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle +30 -0
  275. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle +30 -0
  276. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle +3 -0
  277. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle +3 -0
  278. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle +21 -0
  279. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle +21 -0
  280. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle +3 -0
  281. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle +21 -0
  282. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle +21 -0
  283. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle +30 -0
  284. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-white.mplstyle +30 -0
  285. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle +30 -0
  286. matplotlib_rs/mpl-data/stylelib/seaborn-v0_8.mplstyle +57 -0
  287. matplotlib_rs/mpl-data/stylelib/tableau-colorblind10.mplstyle +3 -0
  288. matplotlib_rs/mpl_toolkits/__init__.py +3 -0
  289. matplotlib_rs/mpl_toolkits/axes_grid1/__init__.py +11 -0
  290. matplotlib_rs/mpl_toolkits/axes_grid1/anchored_artists.py +415 -0
  291. matplotlib_rs/mpl_toolkits/axes_grid1/axes_divider.py +619 -0
  292. matplotlib_rs/mpl_toolkits/axes_grid1/axes_grid.py +565 -0
  293. matplotlib_rs/mpl_toolkits/axes_grid1/axes_rgb.py +158 -0
  294. matplotlib_rs/mpl_toolkits/axes_grid1/axes_size.py +272 -0
  295. matplotlib_rs/mpl_toolkits/axes_grid1/inset_locator.py +525 -0
  296. matplotlib_rs/mpl_toolkits/axes_grid1/mpl_axes.py +129 -0
  297. matplotlib_rs/mpl_toolkits/axes_grid1/parasite_axes.py +261 -0
  298. matplotlib_rs/mpl_toolkits/axisartist/__init__.py +15 -0
  299. matplotlib_rs/mpl_toolkits/axisartist/angle_helper.py +396 -0
  300. matplotlib_rs/mpl_toolkits/axisartist/axes_divider.py +3 -0
  301. matplotlib_rs/mpl_toolkits/axisartist/axis_artist.py +1148 -0
  302. matplotlib_rs/mpl_toolkits/axisartist/axisline_style.py +193 -0
  303. matplotlib_rs/mpl_toolkits/axisartist/axislines.py +475 -0
  304. matplotlib_rs/mpl_toolkits/axisartist/floating_axes.py +265 -0
  305. matplotlib_rs/mpl_toolkits/axisartist/grid_finder.py +329 -0
  306. matplotlib_rs/mpl_toolkits/axisartist/grid_helper_curvelinear.py +353 -0
  307. matplotlib_rs/mpl_toolkits/axisartist/parasite_axes.py +8 -0
  308. matplotlib_rs/mpl_toolkits/mplot3d/__init__.py +4 -0
  309. matplotlib_rs/mpl_toolkits/mplot3d/art3d.py +1758 -0
  310. matplotlib_rs/mpl_toolkits/mplot3d/axes3d.py +4462 -0
  311. matplotlib_rs/mpl_toolkits/mplot3d/axis3d.py +807 -0
  312. matplotlib_rs/mpl_toolkits/mplot3d/proj3d.py +270 -0
  313. matplotlib_rs/offsetbox.py +1726 -0
  314. matplotlib_rs/patches.py +5049 -0
  315. matplotlib_rs/path.py +1147 -0
  316. matplotlib_rs/patheffects.py +512 -0
  317. matplotlib_rs/projections/__init__.py +126 -0
  318. matplotlib_rs/projections/geo.py +512 -0
  319. matplotlib_rs/projections/polar.py +1518 -0
  320. matplotlib_rs/pylab.py +68 -0
  321. matplotlib_rs/pyplot.py +4834 -0
  322. matplotlib_rs/quiver.py +1236 -0
  323. matplotlib_rs/rcsetup.py +3435 -0
  324. matplotlib_rs/sankey.py +815 -0
  325. matplotlib_rs/scale.py +1002 -0
  326. matplotlib_rs/spines.py +618 -0
  327. matplotlib_rs/stackplot.py +144 -0
  328. matplotlib_rs/streamplot.py +768 -0
  329. matplotlib_rs/style/__init__.py +269 -0
  330. matplotlib_rs/style/core.py +28 -0
  331. matplotlib_rs/table.py +860 -0
  332. matplotlib_rs/texmanager.py +375 -0
  333. matplotlib_rs/text.py +2412 -0
  334. matplotlib_rs/textpath.py +377 -0
  335. matplotlib_rs/ticker.py +3111 -0
  336. matplotlib_rs/transforms.py +3069 -0
  337. matplotlib_rs/tri/__init__.py +24 -0
  338. matplotlib_rs/tri/_triangulation.py +248 -0
  339. matplotlib_rs/tri/_tricontour.py +271 -0
  340. matplotlib_rs/tri/_trifinder.py +97 -0
  341. matplotlib_rs/tri/_triinterpolate.py +1575 -0
  342. matplotlib_rs/tri/_tripcolor.py +170 -0
  343. matplotlib_rs/tri/_triplot.py +87 -0
  344. matplotlib_rs/tri/_trirefine.py +308 -0
  345. matplotlib_rs/tri/_tritools.py +264 -0
  346. matplotlib_rs/typing.py +597 -0
  347. matplotlib_rs/units.py +196 -0
  348. matplotlib_rs/widgets.py +4455 -0
  349. matplotlib_rs-0.0.8.dist-info/METADATA +392 -0
  350. matplotlib_rs-0.0.8.dist-info/RECORD +352 -0
  351. matplotlib_rs-0.0.8.dist-info/WHEEL +4 -0
  352. matplotlib_rs-0.0.8.dist-info/sboms/matplotlib-rs.cyclonedx.json +4390 -0
@@ -0,0 +1,618 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ from collections.abc import MutableMapping
3
+ import functools
4
+
5
+ import numpy as np
6
+
7
+ import matplotlib_rs as mpl
8
+ from matplotlib_rs import _api, _docstring
9
+ from matplotlib_rs.artist import allow_rasterization
10
+ import matplotlib_rs.transforms as mtransforms
11
+ import matplotlib_rs.patches as mpatches
12
+ import matplotlib_rs.path as mpath
13
+
14
+
15
+ class Spine(mpatches.Patch):
16
+ """
17
+ An axis spine -- the line noting the data area boundaries.
18
+
19
+ Spines are the lines connecting the axis tick marks and noting the
20
+ boundaries of the data area. They can be placed at arbitrary
21
+ positions. See `~.Spine.set_position` for more information.
22
+
23
+ The default position is ``('outward', 0)``.
24
+
25
+ Spines are subclasses of `.Patch`, and inherit much of their behavior.
26
+
27
+ Spines draw a line, a circle, or an arc depending on if
28
+ `~.Spine.set_patch_line`, `~.Spine.set_patch_circle`, or
29
+ `~.Spine.set_patch_arc` has been called. Line-like is the default.
30
+
31
+ For examples see :ref:`spines_examples`.
32
+ """
33
+ def __str__(self):
34
+ return "Spine"
35
+
36
+ @_docstring.interpd
37
+ def __init__(self, axes, spine_type, path, **kwargs):
38
+ """
39
+ Parameters
40
+ ----------
41
+ axes : `~matplotlib.axes.Axes`
42
+ The `~.axes.Axes` instance containing the spine.
43
+ spine_type : str
44
+ The spine type.
45
+ path : `~matplotlib.path.Path`
46
+ The `.Path` instance used to draw the spine.
47
+
48
+ Other Parameters
49
+ ----------------
50
+ **kwargs
51
+ Valid keyword arguments are:
52
+
53
+ %(Patch:kwdoc)s
54
+ """
55
+ super().__init__(**kwargs)
56
+ self.axes = axes
57
+ self.set_figure(self.axes.get_figure(root=False))
58
+ self.spine_type = spine_type
59
+ self.set_facecolor('none')
60
+ self.set_edgecolor(mpl.rcParams['axes.edgecolor'])
61
+ self.set_linewidth(mpl.rcParams['axes.linewidth'])
62
+ self.set_capstyle('projecting')
63
+ self.axis = None
64
+
65
+ self.set_zorder(2.5)
66
+ self.set_transform(self.axes.transData) # default transform
67
+
68
+ self._bounds = None # default bounds
69
+
70
+ # Defer initial position determination. (Not much support for
71
+ # non-rectangular axes is currently implemented, and this lets
72
+ # them pass through the spines machinery without errors.)
73
+ self._position = None
74
+ _api.check_isinstance(mpath.Path, path=path)
75
+ self._path = path
76
+
77
+ # To support drawing both linear and circular spines, this
78
+ # class implements Patch behavior three ways. If
79
+ # self._patch_type == 'line', behave like a mpatches.PathPatch
80
+ # instance. If self._patch_type == 'circle', behave like a
81
+ # mpatches.Ellipse instance. If self._patch_type == 'arc', behave like
82
+ # a mpatches.Arc instance.
83
+ self._patch_type = 'line'
84
+
85
+ # Behavior copied from mpatches.Ellipse:
86
+ # Note: This cannot be calculated until this is added to an Axes
87
+ self._patch_transform = mtransforms.IdentityTransform()
88
+
89
+ def set_patch_arc(self, center, radius, theta1, theta2):
90
+ """Set the spine to be arc-like."""
91
+ self._patch_type = 'arc'
92
+ self._center = center
93
+ self._width = radius * 2
94
+ self._height = radius * 2
95
+ self._theta1 = theta1
96
+ self._theta2 = theta2
97
+ self._path = mpath.Path.arc(theta1, theta2)
98
+ # arc drawn on axes transform
99
+ self.set_transform(self.axes.transAxes)
100
+ self.stale = True
101
+
102
+ def set_patch_circle(self, center, radius):
103
+ """Set the spine to be circular."""
104
+ self._patch_type = 'circle'
105
+ self._center = center
106
+ self._width = radius * 2
107
+ self._height = radius * 2
108
+ # circle drawn on axes transform
109
+ self.set_transform(self.axes.transAxes)
110
+ self.stale = True
111
+
112
+ def set_patch_line(self):
113
+ """Set the spine to be linear."""
114
+ self._patch_type = 'line'
115
+ self.stale = True
116
+
117
+ # Behavior copied from mpatches.Ellipse:
118
+ def _recompute_transform(self):
119
+ """
120
+ Notes
121
+ -----
122
+ This cannot be called until after this has been added to an Axes,
123
+ otherwise unit conversion will fail. This makes it very important to
124
+ call the accessor method and not directly access the transformation
125
+ member variable.
126
+ """
127
+ assert self._patch_type in ('arc', 'circle')
128
+ center = (self.convert_xunits(self._center[0]),
129
+ self.convert_yunits(self._center[1]))
130
+ width = self.convert_xunits(self._width)
131
+ height = self.convert_yunits(self._height)
132
+ self._patch_transform = mtransforms.Affine2D() \
133
+ .scale(width * 0.5, height * 0.5) \
134
+ .translate(*center)
135
+
136
+ def get_patch_transform(self):
137
+ if self._patch_type in ('arc', 'circle'):
138
+ self._recompute_transform()
139
+ return self._patch_transform
140
+ else:
141
+ return super().get_patch_transform()
142
+
143
+ def get_window_extent(self, renderer=None):
144
+ """
145
+ Return the window extent of the spines in display space, including
146
+ padding for ticks (but not their labels)
147
+
148
+ See Also
149
+ --------
150
+ matplotlib.axes.Axes.get_tightbbox
151
+ matplotlib.axes.Axes.get_window_extent
152
+ """
153
+ # make sure the location is updated so that transforms etc are correct:
154
+ self._adjust_location()
155
+ bb = super().get_window_extent(renderer=renderer)
156
+ if self.axis is None or not self.axis.get_visible():
157
+ return bb
158
+ bboxes = [bb]
159
+ drawn_ticks = self.axis._update_ticks()
160
+
161
+ major_tick = next(iter({*drawn_ticks} & {*self.axis.majorTicks}), None)
162
+ minor_tick = next(iter({*drawn_ticks} & {*self.axis.minorTicks}), None)
163
+ for tick in [major_tick, minor_tick]:
164
+ if tick is None:
165
+ continue
166
+ bb0 = bb.frozen()
167
+ tickl = tick._size
168
+ tickdir = tick._tickdir
169
+ if tickdir == 'out':
170
+ padout = 1
171
+ padin = 0
172
+ elif tickdir == 'in':
173
+ padout = 0
174
+ padin = 1
175
+ else:
176
+ padout = 0.5
177
+ padin = 0.5
178
+ dpi = self.get_figure(root=True).dpi
179
+ padout = padout * tickl / 72 * dpi
180
+ padin = padin * tickl / 72 * dpi
181
+
182
+ if tick.tick1line.get_visible():
183
+ if self.spine_type == 'left':
184
+ bb0.x0 = bb0.x0 - padout
185
+ bb0.x1 = bb0.x1 + padin
186
+ elif self.spine_type == 'bottom':
187
+ bb0.y0 = bb0.y0 - padout
188
+ bb0.y1 = bb0.y1 + padin
189
+
190
+ if tick.tick2line.get_visible():
191
+ if self.spine_type == 'right':
192
+ bb0.x1 = bb0.x1 + padout
193
+ bb0.x0 = bb0.x0 - padin
194
+ elif self.spine_type == 'top':
195
+ bb0.y1 = bb0.y1 + padout
196
+ bb0.y0 = bb0.y0 - padout
197
+ bboxes.append(bb0)
198
+
199
+ return mtransforms.Bbox.union(bboxes)
200
+
201
+ def get_path(self):
202
+ return self._path
203
+
204
+ def _ensure_position_is_set(self):
205
+ if self._position is None:
206
+ # default position
207
+ self._position = ('outward', 0.0) # in points
208
+ self.set_position(self._position)
209
+
210
+ def register_axis(self, axis):
211
+ """
212
+ Register an axis.
213
+
214
+ An axis should be registered with its corresponding spine from
215
+ the Axes instance. This allows the spine to clear any axis
216
+ properties when needed.
217
+ """
218
+ self.axis = axis
219
+ self.stale = True
220
+
221
+ def clear(self):
222
+ """Clear the current spine."""
223
+ self._clear()
224
+ if self.axis is not None:
225
+ self.axis.clear()
226
+
227
+ def _clear(self):
228
+ """
229
+ Clear things directly related to the spine.
230
+
231
+ In this way it is possible to avoid clearing the Axis as well when calling
232
+ from library code where it is known that the Axis is cleared separately.
233
+ """
234
+ self._position = None # clear position
235
+
236
+ def _get_bounds_or_viewLim(self):
237
+ """
238
+ Get the bounds of the spine.
239
+
240
+ If self._bounds is None, return self.axes.viewLim.intervalx
241
+ or self.axes.viewLim.intervaly based on self.spine_type
242
+ """
243
+ if self._bounds is not None:
244
+ low, high = self._bounds
245
+ elif self.spine_type in ('left', 'right'):
246
+ low, high = self.axes.viewLim.intervaly
247
+ elif self.spine_type in ('top', 'bottom'):
248
+ low, high = self.axes.viewLim.intervalx
249
+ else:
250
+ raise ValueError(f'spine_type: {self.spine_type} not supported')
251
+ return low, high
252
+
253
+ def _adjust_location(self):
254
+ """Automatically set spine bounds to the view interval."""
255
+
256
+ if self.spine_type == 'circle':
257
+ return
258
+
259
+ low, high = self._get_bounds_or_viewLim()
260
+
261
+ if self._patch_type == 'arc':
262
+ if self.spine_type in ('bottom', 'top'):
263
+ try:
264
+ direction = self.axes.get_theta_direction()
265
+ except AttributeError:
266
+ direction = 1
267
+ try:
268
+ offset = self.axes.get_theta_offset()
269
+ except AttributeError:
270
+ offset = 0
271
+ low = low * direction + offset
272
+ high = high * direction + offset
273
+ if low > high:
274
+ low, high = high, low
275
+
276
+ self._path = mpath.Path.arc(np.rad2deg(low), np.rad2deg(high))
277
+
278
+ if self.spine_type == 'bottom':
279
+ if self.axis is None:
280
+ tr = mtransforms.IdentityTransform()
281
+ else:
282
+ tr = self.axis.get_transform()
283
+ rmin, rmax = tr.transform(self.axes.viewLim.intervaly)
284
+ try:
285
+ rorigin = self.axes.get_rorigin()
286
+ except AttributeError:
287
+ rorigin = rmin
288
+ else:
289
+ rorigin = tr.transform(rorigin)
290
+ scaled_diameter = (rmin - rorigin) / (rmax - rorigin)
291
+ self._height = scaled_diameter
292
+ self._width = scaled_diameter
293
+
294
+ else:
295
+ raise ValueError('unable to set bounds for spine "%s"' %
296
+ self.spine_type)
297
+ else:
298
+ v1 = self._path.vertices
299
+ assert v1.shape == (2, 2), 'unexpected vertices shape'
300
+ if self.spine_type in ['left', 'right']:
301
+ v1[0, 1] = low
302
+ v1[1, 1] = high
303
+ elif self.spine_type in ['bottom', 'top']:
304
+ v1[0, 0] = low
305
+ v1[1, 0] = high
306
+ else:
307
+ raise ValueError('unable to set bounds for spine "%s"' %
308
+ self.spine_type)
309
+
310
+ @allow_rasterization
311
+ def draw(self, renderer):
312
+ self._adjust_location()
313
+ ret = super().draw(renderer)
314
+ self.stale = False
315
+ return ret
316
+
317
+ def set_position(self, position):
318
+ """
319
+ Set the position of the spine.
320
+
321
+ Spine position is specified by a 2 tuple of (position type,
322
+ amount). The position types are:
323
+
324
+ * 'outward': place the spine out from the data area by the specified
325
+ number of points. (Negative values place the spine inwards.)
326
+ * 'axes': place the spine at the specified Axes coordinate (0 to 1).
327
+ * 'data': place the spine at the specified data coordinate.
328
+
329
+ Additionally, shorthand notations define a special positions:
330
+
331
+ * 'center' -> ``('axes', 0.5)``
332
+ * 'zero' -> ``('data', 0.0)``
333
+
334
+ Examples
335
+ --------
336
+ :doc:`/gallery/spines/spine_placement_demo`
337
+ """
338
+ if position in ('center', 'zero'): # special positions
339
+ pass
340
+ else:
341
+ if len(position) != 2:
342
+ raise ValueError("position should be 'center' or 2-tuple")
343
+ if position[0] not in ['outward', 'axes', 'data']:
344
+ raise ValueError("position[0] should be one of 'outward', "
345
+ "'axes', or 'data' ")
346
+ self._position = position
347
+ self.set_transform(self.get_spine_transform())
348
+ if self.axis is not None:
349
+ self.axis.reset_ticks()
350
+ self.stale = True
351
+
352
+ def get_position(self):
353
+ """Return the spine position."""
354
+ self._ensure_position_is_set()
355
+ return self._position
356
+
357
+ def get_spine_transform(self):
358
+ """Return the spine transform."""
359
+ self._ensure_position_is_set()
360
+
361
+ position = self._position
362
+ if isinstance(position, str):
363
+ if position == 'center':
364
+ position = ('axes', 0.5)
365
+ elif position == 'zero':
366
+ position = ('data', 0)
367
+ assert len(position) == 2, 'position should be 2-tuple'
368
+ position_type, amount = position
369
+ _api.check_in_list(['axes', 'outward', 'data'],
370
+ position_type=position_type)
371
+ if self.spine_type in ['left', 'right']:
372
+ base_transform = self.axes.get_yaxis_transform(which='grid')
373
+ elif self.spine_type in ['top', 'bottom']:
374
+ base_transform = self.axes.get_xaxis_transform(which='grid')
375
+ else:
376
+ raise ValueError(f'unknown spine spine_type: {self.spine_type!r}')
377
+
378
+ if position_type == 'outward':
379
+ if amount == 0: # short circuit commonest case
380
+ return base_transform
381
+ else:
382
+ offset_vec = {'left': (-1, 0), 'right': (1, 0),
383
+ 'bottom': (0, -1), 'top': (0, 1),
384
+ }[self.spine_type]
385
+ # calculate x and y offset in dots
386
+ offset_dots = amount * np.array(offset_vec) / 72
387
+ return (base_transform
388
+ + mtransforms.ScaledTranslation(
389
+ *offset_dots, self.get_figure(root=False).dpi_scale_trans))
390
+ elif position_type == 'axes':
391
+ if self.spine_type in ['left', 'right']:
392
+ # keep y unchanged, fix x at amount
393
+ return (mtransforms.Affine2D.from_values(0, 0, 0, 1, amount, 0)
394
+ + base_transform)
395
+ elif self.spine_type in ['bottom', 'top']:
396
+ # keep x unchanged, fix y at amount
397
+ return (mtransforms.Affine2D.from_values(1, 0, 0, 0, 0, amount)
398
+ + base_transform)
399
+ elif position_type == 'data':
400
+ if self.spine_type in ('right', 'top'):
401
+ # The right and top spines have a default position of 1 in
402
+ # axes coordinates. When specifying the position in data
403
+ # coordinates, we need to calculate the position relative to 0.
404
+ amount -= 1
405
+ if self.spine_type in ('left', 'right'):
406
+ return mtransforms.blended_transform_factory(
407
+ mtransforms.Affine2D().translate(amount, 0)
408
+ + self.axes.transData,
409
+ self.axes.transData)
410
+ elif self.spine_type in ('bottom', 'top'):
411
+ return mtransforms.blended_transform_factory(
412
+ self.axes.transData,
413
+ mtransforms.Affine2D().translate(0, amount)
414
+ + self.axes.transData)
415
+
416
+ def set_bounds(self, low=None, high=None):
417
+ """
418
+ Set the spine bounds.
419
+
420
+ Parameters
421
+ ----------
422
+ low : float or None, optional
423
+ The lower spine bound. Passing *None* leaves the limit unchanged.
424
+
425
+ The bounds may also be passed as the tuple (*low*, *high*) as the
426
+ first positional argument.
427
+
428
+ .. ACCEPTS: (low: float, high: float)
429
+
430
+ high : float or None, optional
431
+ The higher spine bound. Passing *None* leaves the limit unchanged.
432
+ """
433
+ if self.spine_type == 'circle':
434
+ raise ValueError(
435
+ 'set_bounds() method incompatible with circular spines')
436
+ if high is None and np.iterable(low):
437
+ low, high = low
438
+ old_low, old_high = self._get_bounds_or_viewLim()
439
+ if low is None:
440
+ low = old_low
441
+ if high is None:
442
+ high = old_high
443
+ self._bounds = (low, high)
444
+ self.stale = True
445
+
446
+ def get_bounds(self):
447
+ """Get the bounds of the spine."""
448
+ return self._bounds
449
+
450
+ @classmethod
451
+ def linear_spine(cls, axes, spine_type, **kwargs):
452
+ """Create and return a linear `Spine`."""
453
+ # all values of 0.999 get replaced upon call to set_bounds()
454
+ if spine_type == 'left':
455
+ path = mpath.Path([(0.0, 0.999), (0.0, 0.999)])
456
+ elif spine_type == 'right':
457
+ path = mpath.Path([(1.0, 0.999), (1.0, 0.999)])
458
+ elif spine_type == 'bottom':
459
+ path = mpath.Path([(0.999, 0.0), (0.999, 0.0)])
460
+ elif spine_type == 'top':
461
+ path = mpath.Path([(0.999, 1.0), (0.999, 1.0)])
462
+ else:
463
+ raise ValueError('unable to make path for spine "%s"' % spine_type)
464
+ result = cls(axes, spine_type, path, **kwargs)
465
+ result.set_visible(mpl.rcParams[f'axes.spines.{spine_type}'])
466
+
467
+ return result
468
+
469
+ @classmethod
470
+ def arc_spine(cls, axes, spine_type, center, radius, theta1, theta2,
471
+ **kwargs):
472
+ """Create and return an arc `Spine`."""
473
+ path = mpath.Path.arc(theta1, theta2)
474
+ result = cls(axes, spine_type, path, **kwargs)
475
+ result.set_patch_arc(center, radius, theta1, theta2)
476
+ return result
477
+
478
+ @classmethod
479
+ def circular_spine(cls, axes, center, radius, **kwargs):
480
+ """Create and return a circular `Spine`."""
481
+ path = mpath.Path.unit_circle()
482
+ spine_type = 'circle'
483
+ result = cls(axes, spine_type, path, **kwargs)
484
+ result.set_patch_circle(center, radius)
485
+ return result
486
+
487
+ def set_color(self, c):
488
+ """
489
+ Set the edgecolor.
490
+
491
+ Parameters
492
+ ----------
493
+ c : :mpltype:`color`
494
+
495
+ Notes
496
+ -----
497
+ This method does not modify the facecolor (which defaults to "none"),
498
+ unlike the `.Patch.set_color` method defined in the parent class. Use
499
+ `.Patch.set_facecolor` to set the facecolor.
500
+ """
501
+ self.set_edgecolor(c)
502
+ self.stale = True
503
+
504
+
505
+ class SpinesProxy:
506
+ """
507
+ A proxy to broadcast ``set_*()`` and ``set()`` method calls to contained `.Spines`.
508
+
509
+ The proxy cannot be used for any other operations on its members.
510
+
511
+ The supported methods are determined dynamically based on the contained
512
+ spines. If not all spines support a given method, it's executed only on
513
+ the subset of spines that support it.
514
+ """
515
+ def __init__(self, spine_dict):
516
+ self._spine_dict = spine_dict
517
+
518
+ def __getattr__(self, name):
519
+ broadcast_targets = [spine for spine in self._spine_dict.values()
520
+ if hasattr(spine, name)]
521
+ if (name != 'set' and not name.startswith('set_')) or not broadcast_targets:
522
+ raise AttributeError(
523
+ f"'SpinesProxy' object has no attribute '{name}'")
524
+
525
+ def x(_targets, _funcname, *args, **kwargs):
526
+ for spine in _targets:
527
+ getattr(spine, _funcname)(*args, **kwargs)
528
+ x = functools.partial(x, broadcast_targets, name)
529
+ x.__doc__ = broadcast_targets[0].__doc__
530
+ return x
531
+
532
+ def __dir__(self):
533
+ names = []
534
+ for spine in self._spine_dict.values():
535
+ names.extend(name
536
+ for name in dir(spine) if name.startswith('set_'))
537
+ return list(sorted(set(names)))
538
+
539
+
540
+ class Spines(MutableMapping):
541
+ r"""
542
+ The container of all `.Spine`\s in an Axes.
543
+
544
+ The interface is dict-like mapping names (e.g. 'left') to `.Spine` objects.
545
+ Additionally, it implements some pandas.Series-like features like accessing
546
+ elements by attribute::
547
+
548
+ spines['top'].set_visible(False)
549
+ spines.top.set_visible(False)
550
+
551
+ Multiple spines can be addressed simultaneously by passing a list::
552
+
553
+ spines[['top', 'right']].set_visible(False)
554
+
555
+ Use an open slice to address all spines::
556
+
557
+ spines[:].set_visible(False)
558
+
559
+ The latter two indexing methods will return a `SpinesProxy` that broadcasts all
560
+ ``set_*()`` and ``set()`` calls to its members, but cannot be used for any other
561
+ operation.
562
+ """
563
+ def __init__(self, **kwargs):
564
+ self._dict = kwargs
565
+
566
+ @classmethod
567
+ def from_dict(cls, d):
568
+ return cls(**d)
569
+
570
+ def __getstate__(self):
571
+ return self._dict
572
+
573
+ def __setstate__(self, state):
574
+ self.__init__(**state)
575
+
576
+ def __getattr__(self, name):
577
+ try:
578
+ return self._dict[name]
579
+ except KeyError:
580
+ raise AttributeError(
581
+ f"'Spines' object does not contain a '{name}' spine")
582
+
583
+ def __getitem__(self, key):
584
+ if isinstance(key, list):
585
+ unknown_keys = [k for k in key if k not in self._dict]
586
+ if unknown_keys:
587
+ raise KeyError(', '.join(unknown_keys))
588
+ return SpinesProxy({k: v for k, v in self._dict.items()
589
+ if k in key})
590
+ if isinstance(key, tuple):
591
+ raise ValueError('Multiple spines must be passed as a single list')
592
+ if isinstance(key, slice):
593
+ if key.start is None and key.stop is None and key.step is None:
594
+ return SpinesProxy(self._dict)
595
+ else:
596
+ raise ValueError(
597
+ 'Spines does not support slicing except for the fully '
598
+ 'open slice [:] to access all spines.')
599
+ return self._dict[key]
600
+
601
+ def __setitem__(self, key, value):
602
+ # TODO: Do we want to deprecate adding spines?
603
+ self._dict[key] = value
604
+
605
+ def __delitem__(self, key):
606
+ # TODO: Do we want to deprecate deleting spines?
607
+ del self._dict[key]
608
+
609
+ def __iter__(self):
610
+ return iter(self._dict)
611
+
612
+ def __len__(self):
613
+ return len(self._dict)
614
+
615
+
616
+ from ._spines_rs import _patch_spines, _patch_spines_container # noqa: E402
617
+ _patch_spines(Spine)
618
+ _patch_spines_container(Spines, Spine)