matplotlib-rs 0.0.8__cp313-cp313-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.cp313-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,142 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ import inspect
3
+
4
+ from . import _api
5
+
6
+
7
+ def kwarg_doc(text):
8
+ """
9
+ Decorator for defining the kwdoc documentation of artist properties.
10
+
11
+ This decorator can be applied to artist property setter methods.
12
+ The given text is stored in a private attribute ``_kwarg_doc`` on
13
+ the method. It is used to overwrite auto-generated documentation
14
+ in the *kwdoc list* for artists. The kwdoc list is used to document
15
+ ``**kwargs`` when they are properties of an artist. See e.g. the
16
+ ``**kwargs`` section in `.Axes.text`.
17
+
18
+ The text should contain the supported types, as well as the default
19
+ value if applicable, e.g.:
20
+
21
+ @_docstring.kwarg_doc("bool, default: :rc:`text.usetex`")
22
+ def set_usetex(self, usetex):
23
+
24
+ See Also
25
+ --------
26
+ matplotlib.artist.kwdoc
27
+
28
+ """
29
+ def decorator(func):
30
+ func._kwarg_doc = text
31
+ return func
32
+ return decorator
33
+
34
+
35
+ class Substitution:
36
+ """
37
+ A decorator that performs %-substitution on an object's docstring.
38
+
39
+ This decorator should be robust even if ``obj.__doc__`` is None (for
40
+ example, if -OO was passed to the interpreter).
41
+
42
+ Usage: construct a docstring.Substitution with a sequence or dictionary
43
+ suitable for performing substitution; then decorate a suitable function
44
+ with the constructed object, e.g.::
45
+
46
+ sub_author_name = Substitution(author='Jason')
47
+
48
+ @sub_author_name
49
+ def some_function(x):
50
+ "%(author)s wrote this function"
51
+
52
+ # note that some_function.__doc__ is now "Jason wrote this function"
53
+
54
+ One can also use positional arguments::
55
+
56
+ sub_first_last_names = Substitution('Edgar Allen', 'Poe')
57
+
58
+ @sub_first_last_names
59
+ def some_function(x):
60
+ "%s %s wrote the Raven"
61
+ """
62
+ def __init__(self, *args, **kwargs):
63
+ if args and kwargs:
64
+ raise TypeError("Only positional or keyword args are allowed")
65
+ self.params = args or kwargs
66
+
67
+ def __call__(self, func):
68
+ if func.__doc__:
69
+ func.__doc__ = inspect.cleandoc(func.__doc__) % self.params
70
+ return func
71
+
72
+
73
+ class _ArtistKwdocLoader(dict):
74
+ def __missing__(self, key):
75
+ if not key.endswith(":kwdoc"):
76
+ raise KeyError(key)
77
+ name = key[:-len(":kwdoc")]
78
+ from .artist import Artist, kwdoc
79
+ try:
80
+ cls, = (cls for cls in _api.recursive_subclasses(Artist)
81
+ if cls.__name__ == name)
82
+ except ValueError as e:
83
+ raise KeyError(key) from e
84
+ return self.setdefault(key, kwdoc(cls))
85
+
86
+
87
+ class _ArtistPropertiesSubstitution:
88
+ """
89
+ A class to substitute formatted placeholders in docstrings.
90
+
91
+ This is realized in a single instance ``_docstring.interpd``.
92
+
93
+ Use `~._ArtistPropertiesSubstition.register` to define placeholders and
94
+ their substitution, e.g. ``_docstring.interpd.register(name="some value")``.
95
+
96
+ Use this as a decorator to apply the substitution::
97
+
98
+ @_docstring.interpd
99
+ def some_func():
100
+ '''Replace %(name)s.'''
101
+
102
+ Decorating a class triggers substitution both on the class docstring and
103
+ on the class' ``__init__`` docstring (which is a commonly required
104
+ pattern for Artist subclasses).
105
+
106
+ Substitutions of the form ``%(classname:kwdoc)s`` (ending with the
107
+ literal ":kwdoc" suffix) trigger lookup of an Artist subclass with the
108
+ given *classname*, and are substituted with the `.kwdoc` of that class.
109
+ """
110
+
111
+ def __init__(self):
112
+ self.params = _ArtistKwdocLoader()
113
+
114
+ def register(self, **kwargs):
115
+ """
116
+ Register substitutions.
117
+
118
+ ``_docstring.interpd.register(name="some value")`` makes "name" available
119
+ as a named parameter that will be replaced by "some value".
120
+ """
121
+ self.params.update(**kwargs)
122
+
123
+ def __call__(self, obj):
124
+ if obj.__doc__:
125
+ obj.__doc__ = inspect.cleandoc(obj.__doc__) % self.params
126
+ if isinstance(obj, type) and obj.__init__ != object.__init__:
127
+ self(obj.__init__)
128
+ return obj
129
+
130
+
131
+ def copy(source):
132
+ """Copy a docstring from another source function (if present)."""
133
+ def do_copy(target):
134
+ if source.__doc__:
135
+ target.__doc__ = source.__doc__
136
+ return target
137
+ return do_copy
138
+
139
+
140
+ # Create a decorator that will house the various docstring snippets reused
141
+ # throughout Matplotlib.
142
+ interpd = _ArtistPropertiesSubstitution()
@@ -0,0 +1,178 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ """
3
+ Enums representing sets of strings that Matplotlib uses as input parameters.
4
+
5
+ Matplotlib often uses simple data types like strings or tuples to define a
6
+ concept; e.g. the line capstyle can be specified as one of 'butt', 'round',
7
+ or 'projecting'. The classes in this module are used internally and serve to
8
+ document these concepts formally.
9
+
10
+ As an end-user you will not use these classes directly, but only the values
11
+ they define.
12
+ """
13
+
14
+ from enum import Enum
15
+ from . import _docstring
16
+
17
+
18
+ class JoinStyle(str, Enum):
19
+ """
20
+ Define how the connection between two line segments is drawn.
21
+
22
+ For a visual impression of each *JoinStyle*, `view these docs online
23
+ <JoinStyle>`, or run `JoinStyle.demo`.
24
+
25
+ Lines in Matplotlib are typically defined by a 1D `~.path.Path` and a
26
+ finite ``linewidth``, where the underlying 1D `~.path.Path` represents the
27
+ center of the stroked line.
28
+
29
+ By default, `~.backend_bases.GraphicsContextBase` defines the boundaries of
30
+ a stroked line to simply be every point within some radius,
31
+ ``linewidth/2``, away from any point of the center line. However, this
32
+ results in corners appearing "rounded", which may not be the desired
33
+ behavior if you are drawing, for example, a polygon or pointed star.
34
+
35
+ **Supported values:**
36
+
37
+ .. rst-class:: value-list
38
+
39
+ 'miter'
40
+ the "arrow-tip" style. Each boundary of the filled-in area will
41
+ extend in a straight line parallel to the tangent vector of the
42
+ centerline at the point it meets the corner, until they meet in a
43
+ sharp point.
44
+ 'round'
45
+ stokes every point within a radius of ``linewidth/2`` of the center
46
+ lines.
47
+ 'bevel'
48
+ the "squared-off" style. It can be thought of as a rounded corner
49
+ where the "circular" part of the corner has been cut off.
50
+
51
+ .. note::
52
+
53
+ Very long miter tips are cut off (to form a *bevel*) after a
54
+ backend-dependent limit called the "miter limit", which specifies the
55
+ maximum allowed ratio of miter length to line width. For example, the
56
+ PDF backend uses the default value of 10 specified by the PDF standard,
57
+ while the SVG backend does not even specify the miter limit, resulting
58
+ in a default value of 4 per the SVG specification. Matplotlib does not
59
+ currently allow the user to adjust this parameter.
60
+
61
+ A more detailed description of the effect of a miter limit can be found
62
+ in the `Mozilla Developer Docs
63
+ <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit>`_
64
+
65
+ .. plot::
66
+ :alt: Demo of possible JoinStyle's
67
+
68
+ from matplotlib_rs._enums import JoinStyle
69
+ JoinStyle.demo()
70
+
71
+ """
72
+
73
+ miter = "miter"
74
+ round = "round"
75
+ bevel = "bevel"
76
+
77
+ @staticmethod
78
+ def demo():
79
+ """Demonstrate how each JoinStyle looks for various join angles."""
80
+ import numpy as np
81
+ import matplotlib_rs.pyplot as plt
82
+
83
+ def plot_angle(ax, x, y, angle, style):
84
+ phi = np.radians(angle)
85
+ xx = [x + .5, x, x + .5*np.cos(phi)]
86
+ yy = [y, y, y + .5*np.sin(phi)]
87
+ ax.plot(xx, yy, lw=12, color='tab:blue', solid_joinstyle=style)
88
+ ax.plot(xx, yy, lw=1, color='black')
89
+ ax.plot(xx[1], yy[1], 'o', color='tab:red', markersize=3)
90
+
91
+ fig, ax = plt.subplots(figsize=(5, 4), constrained_layout=True)
92
+ ax.set_title('Join style')
93
+ for x, style in enumerate(['miter', 'round', 'bevel']):
94
+ ax.text(x, 5, style)
95
+ for y, angle in enumerate([20, 45, 60, 90, 120]):
96
+ plot_angle(ax, x, y, angle, style)
97
+ if x == 0:
98
+ ax.text(-1.3, y, f'{angle} degrees')
99
+ ax.set_xlim(-1.5, 2.75)
100
+ ax.set_ylim(-.5, 5.5)
101
+ ax.set_axis_off()
102
+ fig.show()
103
+
104
+
105
+ JoinStyle.input_description = "{" \
106
+ + ", ".join([f"'{js.name}'" for js in JoinStyle]) \
107
+ + "}"
108
+
109
+
110
+ class CapStyle(str, Enum):
111
+ r"""
112
+ Define how the two endpoints (caps) of an unclosed line are drawn.
113
+
114
+ How to draw the start and end points of lines that represent a closed curve
115
+ (i.e. that end in a `~.path.Path.CLOSEPOLY`) is controlled by the line's
116
+ `JoinStyle`. For all other lines, how the start and end points are drawn is
117
+ controlled by the *CapStyle*.
118
+
119
+ For a visual impression of each *CapStyle*, `view these docs online
120
+ <CapStyle>` or run `CapStyle.demo`.
121
+
122
+ By default, `~.backend_bases.GraphicsContextBase` draws a stroked line as
123
+ squared off at its endpoints.
124
+
125
+ **Supported values:**
126
+
127
+ .. rst-class:: value-list
128
+
129
+ 'butt'
130
+ the line is squared off at its endpoint.
131
+ 'projecting'
132
+ the line is squared off as in *butt*, but the filled in area
133
+ extends beyond the endpoint a distance of ``linewidth/2``.
134
+ 'round'
135
+ like *butt*, but a semicircular cap is added to the end of the
136
+ line, of radius ``linewidth/2``.
137
+
138
+ .. plot::
139
+ :alt: Demo of possible CapStyle's
140
+
141
+ from matplotlib_rs._enums import CapStyle
142
+ CapStyle.demo()
143
+
144
+ """
145
+ butt = "butt"
146
+ projecting = "projecting"
147
+ round = "round"
148
+
149
+ @staticmethod
150
+ def demo():
151
+ """Demonstrate how each CapStyle looks for a thick line segment."""
152
+ import matplotlib_rs.pyplot as plt
153
+
154
+ fig = plt.figure(figsize=(4, 1.2))
155
+ ax = fig.add_axes((0, 0, 1, 0.8))
156
+ ax.set_title('Cap style')
157
+
158
+ for x, style in enumerate(['butt', 'round', 'projecting']):
159
+ ax.text(x+0.25, 0.85, style, ha='center')
160
+ xx = [x, x+0.5]
161
+ yy = [0, 0]
162
+ ax.plot(xx, yy, lw=12, color='tab:blue', solid_capstyle=style)
163
+ ax.plot(xx, yy, lw=1, color='black')
164
+ ax.plot(xx, yy, 'o', color='tab:red', markersize=3)
165
+
166
+ ax.set_ylim(-.5, 1.5)
167
+ ax.set_axis_off()
168
+ fig.show()
169
+
170
+
171
+ CapStyle.input_description = "{" \
172
+ + ", ".join([f"'{cs.name}'" for cs in CapStyle]) \
173
+ + "}"
174
+
175
+ _docstring.interpd.register(
176
+ JoinStyle=JoinStyle.input_description,
177
+ CapStyle=CapStyle.input_description,
178
+ )
@@ -0,0 +1,294 @@
1
+ """
2
+ The Rust side of `matplotlib.figure.Figure`.
3
+
4
+ The Python Figure keeps matplotlib's state and logic (size, dpi, layout
5
+ engines, axes management, ``savefig``); its Rust twin mirrors the geometry
6
+ and draws the figure: the patch, the axes and the figure-level artists.
7
+ """
8
+
9
+ import functools
10
+
11
+ from . import _mplrs
12
+ from . import artist as martist
13
+ from . import patches as mpatches
14
+ from . import transforms as mtransforms
15
+ from .backend_bases import DrawEvent
16
+ from .axes._base_rs import _FlushBbox, _rs_native
17
+
18
+
19
+ class _FlushAffine2D(mtransforms.Affine2D):
20
+ """An Affine2D whose changes are mirrored to the Rust model."""
21
+
22
+ def __init__(self, owner, matrix=None, **kwargs):
23
+ import weakref
24
+ super().__init__(matrix, **kwargs)
25
+ self._rs_owner_ref = weakref.ref(owner)
26
+
27
+ def invalidate(self):
28
+ owner = self._rs_owner_ref()
29
+ if owner is not None:
30
+ martist._DIRTY.add(owner)
31
+ return super().invalidate()
32
+
33
+
34
+ class _FlushBboxTransformTo(mtransforms.BboxTransformTo):
35
+ """``transFigure``: its ``_boxout`` is replaced by ``bbox_inches='tight'``."""
36
+
37
+ def __init__(self, boxout, owner, **kwargs):
38
+ import weakref
39
+ super().__init__(boxout, **kwargs)
40
+ self._rs_owner_ref = weakref.ref(owner)
41
+ self._rs_spec = "figure"
42
+
43
+ def invalidate(self):
44
+ owner = self._rs_owner_ref()
45
+ if owner is not None:
46
+ martist._DIRTY.add(owner)
47
+ return super().invalidate()
48
+
49
+
50
+ # transforms print (and SVG hashes clip paths by) their class name: keep
51
+ # matplotlib's names
52
+ _FlushAffine2D.__name__ = "Affine2D"
53
+ _FlushBboxTransformTo.__name__ = "BboxTransformTo"
54
+
55
+
56
+ # the category the Rust figure gives to natively drawn artists
57
+ _NATIVE_CATEGORY = {"Line2D": 2, "Patch": 3, "Text": 4}
58
+
59
+
60
+ def _rs_fig_native(a, category):
61
+ if not _rs_native(a):
62
+ return False
63
+ return _NATIVE_CATEGORY.get(type(a._h).__name__) == category
64
+
65
+
66
+ def _rs_fig_switch(rootref, category, sfid, a):
67
+ root = rootref()
68
+ native = _rs_fig_native(a, category)
69
+ if root is None or native == a.__dict__.get("_rs_native_in"):
70
+ return
71
+ old = a._h if a._rs_native_in else a
72
+ new = a._h if native else a
73
+ if root._rs.replace_artist(old, new, sfid):
74
+ a._rs_native_in = native
75
+
76
+
77
+ def _rs_fig_attach(fig, a, category):
78
+ """Add figure-level artist *a* of (sub)figure *fig* to the Rust figure."""
79
+ import weakref
80
+ root = fig.get_figure(root=True)
81
+ sfid = fig.__dict__.get("_rs_sfid")
82
+ native = _rs_fig_native(a, category)
83
+ a._rs_native_in = native
84
+ a._rs_switch = functools.partial(_rs_fig_switch, weakref.ref(root), category, sfid)
85
+ if native:
86
+ martist._DIRTY.discard(a)
87
+ a._rs_sync()
88
+ root._rs.add_artist(a._h, category, sfid)
89
+ else:
90
+ root._rs.add_artist(a, category, sfid)
91
+ owner_list = a._remove_method
92
+
93
+ def remove(artist):
94
+ owner_list(artist)
95
+ root._rs.remove_artist(
96
+ artist._h if artist.__dict__.get("_rs_native_in") else artist, sfid)
97
+
98
+ a._remove_method = remove
99
+
100
+
101
+ def _rs_sync_subfigs(fig):
102
+ """Mirror the zorder and visibility of the subfigures of *fig*."""
103
+ root = fig.get_figure(root=True)
104
+ for sf in fig.subfigs:
105
+ sfid = sf.__dict__.get("_rs_sfid")
106
+ if sfid is not None:
107
+ root._rs.subfig_state(sfid, float(sf.zorder), bool(sf.get_visible()))
108
+ _rs_sync_subfigs(sf)
109
+
110
+
111
+ def _patch_figure(FigureBase, Figure, SubFigure):
112
+ orig_init = Figure.__init__
113
+
114
+ @functools.wraps(orig_init)
115
+ def __init__(self, *args, **kwargs):
116
+ self._rs = _mplrs.Figure()
117
+ orig_init(self, *args, **kwargs)
118
+ dpi = self._dpi
119
+ self.bbox_inches = _FlushBbox(self.bbox_inches.get_points(), self)
120
+ self.dpi_scale_trans = _FlushAffine2D(self).scale(dpi)
121
+ self.dpi_scale_trans._rs_spec = "dpi"
122
+ self.bbox = mtransforms.TransformedBbox(self.bbox_inches, self.dpi_scale_trans)
123
+ self.bbox._rs_bbox_spec = "figure"
124
+ self.figbbox = self.bbox
125
+ self.transFigure = _FlushBboxTransformTo(self.bbox, self)
126
+ self.transSubfigure = self.transFigure
127
+ self.patch.set_transform(self.transSubfigure)
128
+ self.patch.__dict__["_h"] = mpatches._RsPatchHandle(self._rs)
129
+ martist._DIRTY.add(self.patch)
130
+ martist._DIRTY.add(self)
131
+
132
+ Figure.__init__ = __init__
133
+
134
+ def _rs_sync(self):
135
+ """Mirror the figure geometry into the Rust figure."""
136
+ w, h = self.bbox_inches.size
137
+ bo = getattr(self.transFigure, "_boxout", None)
138
+ boxout = None if (bo is None or bo is self.bbox) else tuple(map(float, bo.extents))
139
+ self._rs.mirror_state((float(w), float(h)), float(self._dpi), boxout)
140
+
141
+ Figure._rs_sync = _rs_sync
142
+
143
+ def _rs_sync_all(self, renderer=None):
144
+ martist._DIRTY.add(self)
145
+ self._rs.set_saving(bool(self.canvas.is_saving()))
146
+ if renderer is not None:
147
+ from .text import _WRAPPED
148
+ for t in list(_WRAPPED):
149
+ if t._wrap and t.get_figure(root=True) is self:
150
+ t._renderer = renderer
151
+ martist._DIRTY.add(t)
152
+ martist._sync_dirty()
153
+
154
+ Figure._rs_sync_all = _rs_sync_all
155
+
156
+ def _rs_all_axes(self):
157
+ out = []
158
+
159
+ def walk(axs):
160
+ for ax in axs:
161
+ out.append(ax)
162
+ walk(ax.child_axes)
163
+
164
+ walk(self.axes)
165
+ return out
166
+
167
+ def draw(self, renderer):
168
+ # docstring inherited
169
+ if not self.get_visible():
170
+ return
171
+ from ._foreign import is_foreign, metrics
172
+ foreign = is_foreign(renderer)
173
+ with self._render_lock, metrics(renderer):
174
+ # applies the aspect of all axes (as matplotlib does)
175
+ self._get_draw_artists(renderer)
176
+ try:
177
+ renderer.open_group('figure', gid=self.get_gid())
178
+ if self.axes and self.get_layout_engine() is not None:
179
+ try:
180
+ self.get_layout_engine().execute(self)
181
+ except ValueError:
182
+ pass
183
+ # We don't want to raise an error here, but we also don't
184
+ # want to fail to draw the figure.
185
+ for ax in _rs_all_axes(self):
186
+ ax._rs_prepare_draw(renderer)
187
+ _rs_sync_subfigs(self)
188
+ self._rs_sync_all(renderer)
189
+ with martist._rs_drawing():
190
+ if foreign:
191
+ self._rs.draw_foreign(renderer)
192
+ elif not getattr(renderer, "_rs_disabled", False):
193
+ self._rs.draw_into(renderer._renderer)
194
+ else:
195
+ self._rs.draw_disabled()
196
+ renderer.close_group('figure')
197
+ finally:
198
+ self.stale = False
199
+
200
+ from ._foreign import warn_missing_glyphs
201
+ warn_missing_glyphs()
202
+ DrawEvent("draw_event", self.canvas, renderer)._process()
203
+
204
+ draw.__doc__ = Figure.draw.__doc__
205
+ Figure.draw = martist.allow_rasterization(draw)
206
+
207
+ # -- axes ------------------------------------------------------------------
208
+ orig_add_axes_internal = FigureBase._add_axes_internal
209
+
210
+ @functools.wraps(orig_add_axes_internal)
211
+ def _add_axes_internal(self, ax, key):
212
+ ret = orig_add_axes_internal(self, ax, key)
213
+ rs = ax.__dict__.get("_rs")
214
+ if rs is not None:
215
+ root = self.get_figure(root=True)
216
+ sfid = self.__dict__.get("_rs_sfid")
217
+ if sfid is None:
218
+ root._rs.attach_axes(rs.uid)
219
+ else:
220
+ root._rs.subfig_add_axes(sfid, rs.uid)
221
+ return ret
222
+
223
+ FigureBase._add_axes_internal = _add_axes_internal
224
+
225
+ orig_remove_axes = FigureBase._remove_axes
226
+
227
+ @functools.wraps(orig_remove_axes)
228
+ def _remove_axes(self, ax, owners):
229
+ ret = orig_remove_axes(self, ax, owners)
230
+ rs = ax.__dict__.get("_rs")
231
+ if rs is not None:
232
+ self.get_figure(root=True)._rs.detach_axes(rs.uid)
233
+ return ret
234
+
235
+ FigureBase._remove_axes = _remove_axes
236
+
237
+ # -- figure-level artists ----------------------------------------------------
238
+ def _wrap(name, category):
239
+ orig = getattr(FigureBase, name)
240
+
241
+ @functools.wraps(orig)
242
+ def method(self, *args, **kwargs):
243
+ ret = orig(self, *args, **kwargs)
244
+ _rs_fig_attach(self, ret, category)
245
+ return ret
246
+
247
+ setattr(FigureBase, name, method)
248
+
249
+ _wrap("add_artist", 0)
250
+ _wrap("text", 4)
251
+ _wrap("legend", 6)
252
+
253
+ orig_figimage = Figure.figimage
254
+
255
+ @functools.wraps(orig_figimage)
256
+ def figimage(self, *args, **kwargs):
257
+ ret = orig_figimage(self, *args, **kwargs)
258
+ _rs_fig_attach(self, ret, 5)
259
+ return ret
260
+
261
+ Figure.figimage = figimage
262
+
263
+ # -- subfigures -------------------------------------------------------------
264
+ orig_add_subfigure = FigureBase.add_subfigure
265
+
266
+ @functools.wraps(orig_add_subfigure)
267
+ def add_subfigure(self, subplotspec, **kwargs):
268
+ sf = orig_add_subfigure(self, subplotspec, **kwargs)
269
+ root = self.get_figure(root=True)
270
+ sfid = root._rs.new_subfigure(self.__dict__.get("_rs_sfid"))
271
+ sf._rs_sfid = sfid
272
+ root._rs.subfig_set_patch(sfid, sf.patch._h)
273
+ sf.patch._rs_native_in = True
274
+ martist._DIRTY.add(sf.patch)
275
+ owner_remove = sf._remove_method
276
+
277
+ def remove(s):
278
+ owner_remove(s)
279
+ root._rs.remove_subfigure(sfid)
280
+
281
+ sf._remove_method = remove
282
+ return sf
283
+
284
+ FigureBase.add_subfigure = add_subfigure
285
+
286
+ orig_clear = Figure.clear
287
+
288
+ @functools.wraps(orig_clear)
289
+ def clear(self, keep_observers=False):
290
+ ret = orig_clear(self, keep_observers=keep_observers)
291
+ self._rs.clear()
292
+ return ret
293
+
294
+ Figure.clear = clear