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,170 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ import numpy as np
3
+
4
+ from matplotlib_rs import _api, _docstring
5
+ from matplotlib_rs.collections import PolyCollection, TriMesh
6
+ from matplotlib_rs.tri._triangulation import Triangulation
7
+
8
+
9
+ @_docstring.interpd
10
+ def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
11
+ vmax=None, shading='flat', facecolors=None, **kwargs):
12
+ """
13
+ Create a pseudocolor plot of an unstructured triangular grid.
14
+
15
+ Call signatures::
16
+
17
+ tripcolor(triangulation, c, *, ...)
18
+ tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...)
19
+
20
+ The triangular grid can be specified either by passing a `.Triangulation`
21
+ object as the first parameter, or by passing the points *x*, *y* and
22
+ optionally the *triangles* and a *mask*. See `.Triangulation` for an
23
+ explanation of these parameters.
24
+
25
+ It is possible to pass the triangles positionally, i.e.
26
+ ``tripcolor(x, y, triangles, c, ...)``. However, this is discouraged.
27
+ For more clarity, pass *triangles* via keyword argument.
28
+
29
+ If neither of *triangulation* or *triangles* are given, the triangulation
30
+ is calculated on the fly. In this case, it does not make sense to provide
31
+ colors at the triangle faces via *c* or *facecolors* because there are
32
+ multiple possible triangulations for a group of points and you don't know
33
+ which triangles will be constructed.
34
+
35
+ Parameters
36
+ ----------
37
+ triangulation : `.Triangulation`
38
+ An already created triangular grid.
39
+ x, y, triangles, mask
40
+ Parameters defining the triangular grid. See `.Triangulation`.
41
+ This is mutually exclusive with specifying *triangulation*.
42
+ c : array-like
43
+ The color values, either for the points or for the triangles. Which one
44
+ is automatically inferred from the length of *c*, i.e. does it match
45
+ the number of points or the number of triangles. If there are the same
46
+ number of points and triangles in the triangulation it is assumed that
47
+ color values are defined at points; to force the use of color values at
48
+ triangles use the keyword argument ``facecolors=c`` instead of just
49
+ ``c``.
50
+ This parameter is position-only.
51
+ facecolors : array-like, optional
52
+ Can be used alternatively to *c* to specify colors at the triangle
53
+ faces. This parameter takes precedence over *c*.
54
+ shading : {'flat', 'gouraud'}, default: 'flat'
55
+ If 'flat' and the color values *c* are defined at points, the color
56
+ values used for each triangle are from the mean c of the triangle's
57
+ three points. If *shading* is 'gouraud' then color values must be
58
+ defined at points.
59
+ %(cmap_doc)s
60
+
61
+ %(norm_doc)s
62
+
63
+ %(vmin_vmax_doc)s
64
+
65
+ %(colorizer_doc)s
66
+
67
+ Returns
68
+ -------
69
+ `~matplotlib.collections.PolyCollection` or `~matplotlib.collections.TriMesh`
70
+ The result depends on *shading*: For ``shading='flat'`` the result is a
71
+ `.PolyCollection`, for ``shading='gouraud'`` the result is a `.TriMesh`.
72
+
73
+ Other Parameters
74
+ ----------------
75
+ **kwargs : `~matplotlib.collections.Collection` properties
76
+
77
+ %(Collection:kwdoc)s
78
+ """
79
+ _api.check_in_list(['flat', 'gouraud'], shading=shading)
80
+
81
+ tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args, **kwargs)
82
+
83
+ # Parse the color to be in one of (the other variable will be None):
84
+ # - facecolors: if specified at the triangle faces
85
+ # - point_colors: if specified at the points
86
+ if facecolors is not None:
87
+ if args:
88
+ _api.warn_external(
89
+ "Positional parameter c has no effect when the keyword "
90
+ "facecolors is given")
91
+ point_colors = None
92
+ if len(facecolors) != len(tri.triangles):
93
+ raise ValueError("The length of facecolors must match the number "
94
+ "of triangles")
95
+ else:
96
+ # Color from positional parameter c
97
+ if not args:
98
+ raise TypeError(
99
+ "tripcolor() missing 1 required positional argument: 'c'; or "
100
+ "1 required keyword-only argument: 'facecolors'")
101
+ elif len(args) > 1:
102
+ raise TypeError(f"Unexpected positional parameters: {args[1:]!r}")
103
+ c = np.asarray(args[0])
104
+ if len(c) == len(tri.x):
105
+ # having this before the len(tri.triangles) comparison gives
106
+ # precedence to nodes if there are as many nodes as triangles
107
+ point_colors = c
108
+ facecolors = None
109
+ elif len(c) == len(tri.triangles):
110
+ point_colors = None
111
+ facecolors = c
112
+ else:
113
+ raise ValueError('The length of c must match either the number '
114
+ 'of points or the number of triangles')
115
+
116
+ # Handling of linewidths, shading, edgecolors and antialiased as
117
+ # in Axes.pcolor
118
+ linewidths = (0.25,)
119
+ if 'linewidth' in kwargs:
120
+ kwargs['linewidths'] = kwargs.pop('linewidth')
121
+ kwargs.setdefault('linewidths', linewidths)
122
+
123
+ edgecolors = 'none'
124
+ if 'edgecolor' in kwargs:
125
+ kwargs['edgecolors'] = kwargs.pop('edgecolor')
126
+ ec = kwargs.setdefault('edgecolors', edgecolors)
127
+
128
+ if 'antialiased' in kwargs:
129
+ kwargs['antialiaseds'] = kwargs.pop('antialiased')
130
+ if 'antialiaseds' not in kwargs and ec.lower() == "none":
131
+ kwargs['antialiaseds'] = False
132
+
133
+ if shading == 'gouraud':
134
+ if facecolors is not None:
135
+ raise ValueError(
136
+ "shading='gouraud' can only be used when the colors "
137
+ "are specified at the points, not at the faces.")
138
+ collection = TriMesh(tri, alpha=alpha, array=point_colors,
139
+ cmap=cmap, norm=norm, **kwargs)
140
+ else: # 'flat'
141
+ # Vertices of triangles.
142
+ maskedTris = tri.get_masked_triangles()
143
+ verts = np.stack((tri.x[maskedTris], tri.y[maskedTris]), axis=-1)
144
+
145
+ # Color values.
146
+ if facecolors is None:
147
+ # One color per triangle, the mean of the 3 vertex color values.
148
+ colors = point_colors[maskedTris].mean(axis=1)
149
+ elif tri.mask is not None:
150
+ # Remove color values of masked triangles.
151
+ colors = facecolors[~tri.mask]
152
+ else:
153
+ colors = facecolors
154
+ collection = PolyCollection(verts, alpha=alpha, array=colors,
155
+ cmap=cmap, norm=norm, **kwargs)
156
+
157
+ collection._scale_norm(norm, vmin, vmax)
158
+ ax.grid(False)
159
+
160
+ minx = tri.x.min()
161
+ maxx = tri.x.max()
162
+ miny = tri.y.min()
163
+ maxy = tri.y.max()
164
+ corners = (minx, miny), (maxx, maxy)
165
+ ax.update_datalim(corners)
166
+ ax.autoscale_view()
167
+ # TODO: check whether the above explicit limit handling can be
168
+ # replaced by autolim=True
169
+ ax.add_collection(collection, autolim=False)
170
+ return collection
@@ -0,0 +1,87 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ import numpy as np
3
+ from matplotlib_rs.tri._triangulation import Triangulation
4
+ import matplotlib_rs.cbook as cbook
5
+ import matplotlib_rs.lines as mlines
6
+
7
+
8
+ def triplot(ax, *args, **kwargs):
9
+ """
10
+ Draw an unstructured triangular grid as lines and/or markers.
11
+
12
+ Call signatures::
13
+
14
+ triplot(triangulation, ...)
15
+ triplot(x, y, [triangles], *, [mask=mask], ...)
16
+
17
+ The triangular grid can be specified either by passing a `.Triangulation`
18
+ object as the first parameter, or by passing the points *x*, *y* and
19
+ optionally the *triangles* and a *mask*. If neither of *triangulation* or
20
+ *triangles* are given, the triangulation is calculated on the fly.
21
+
22
+ Parameters
23
+ ----------
24
+ triangulation : `.Triangulation`
25
+ An already created triangular grid.
26
+ x, y, triangles, mask
27
+ Parameters defining the triangular grid. See `.Triangulation`.
28
+ This is mutually exclusive with specifying *triangulation*.
29
+ other_parameters
30
+ All other args and kwargs are forwarded to `~.Axes.plot`.
31
+
32
+ Returns
33
+ -------
34
+ lines : `~matplotlib.lines.Line2D`
35
+ The drawn triangles edges.
36
+ markers : `~matplotlib.lines.Line2D`
37
+ The drawn marker nodes.
38
+ """
39
+ import matplotlib_rs.axes; import matplotlib_rs as matplotlib
40
+
41
+ tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args, **kwargs)
42
+ x, y, edges = (tri.x, tri.y, tri.edges)
43
+
44
+ # Decode plot format string, e.g., 'ro-'
45
+ fmt = args[0] if args else ""
46
+ linestyle, marker, color = matplotlib.axes._base._process_plot_format(fmt)
47
+
48
+ # Insert plot format string into a copy of kwargs (kwargs values prevail).
49
+ kw = cbook.normalize_kwargs(kwargs, mlines.Line2D)
50
+ for key, val in zip(('linestyle', 'marker', 'color'),
51
+ (linestyle, marker, color)):
52
+ if val is not None:
53
+ kw.setdefault(key, val)
54
+
55
+ # Draw lines without markers.
56
+ # Note 1: If we drew markers here, most markers would be drawn more than
57
+ # once as they belong to several edges.
58
+ # Note 2: We insert nan values in the flattened edges arrays rather than
59
+ # plotting directly (triang.x[edges].T, triang.y[edges].T)
60
+ # as it considerably speeds-up code execution.
61
+ linestyle = kw['linestyle']
62
+ kw_lines = {
63
+ **kw,
64
+ 'marker': 'None', # No marker to draw.
65
+ 'zorder': kw.get('zorder', 1), # Path default zorder is used.
66
+ }
67
+ if linestyle not in [None, 'None', '', ' ']:
68
+ tri_lines_x = np.insert(x[edges], 2, np.nan, axis=1)
69
+ tri_lines_y = np.insert(y[edges], 2, np.nan, axis=1)
70
+ tri_lines = ax.plot(tri_lines_x.ravel(), tri_lines_y.ravel(),
71
+ **kw_lines)
72
+ else:
73
+ tri_lines = ax.plot([], [], **kw_lines)
74
+
75
+ # Draw markers separately.
76
+ marker = kw['marker']
77
+ kw_markers = {
78
+ **kw,
79
+ 'linestyle': 'None', # No line to draw.
80
+ }
81
+ kw_markers.pop('label', None)
82
+ if marker not in [None, 'None', '', ' ']:
83
+ tri_markers = ax.plot(x, y, **kw_markers)
84
+ else:
85
+ tri_markers = ax.plot([], [], **kw_markers)
86
+
87
+ return tri_lines + tri_markers
@@ -0,0 +1,308 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ """
3
+ Mesh refinement for triangular grids.
4
+ """
5
+
6
+ import numpy as np
7
+
8
+ from matplotlib_rs import _api
9
+ from matplotlib_rs.tri._triangulation import Triangulation
10
+ import matplotlib_rs.tri._triinterpolate; import matplotlib_rs as matplotlib
11
+
12
+
13
+ class TriRefiner:
14
+ """
15
+ Abstract base class for classes implementing mesh refinement.
16
+
17
+ A TriRefiner encapsulates a Triangulation object and provides tools for
18
+ mesh refinement and interpolation.
19
+
20
+ Derived classes must implement:
21
+
22
+ - ``refine_triangulation(return_tri_index=False, **kwargs)`` , where
23
+ the optional keyword arguments *kwargs* are defined in each
24
+ TriRefiner concrete implementation, and which returns:
25
+
26
+ - a refined triangulation,
27
+ - optionally (depending on *return_tri_index*), for each
28
+ point of the refined triangulation: the index of
29
+ the initial triangulation triangle to which it belongs.
30
+
31
+ - ``refine_field(z, triinterpolator=None, **kwargs)``, where:
32
+
33
+ - *z* array of field values (to refine) defined at the base
34
+ triangulation nodes,
35
+ - *triinterpolator* is an optional `~matplotlib.tri.TriInterpolator`,
36
+ - the other optional keyword arguments *kwargs* are defined in
37
+ each TriRefiner concrete implementation;
38
+
39
+ and which returns (as a tuple) a refined triangular mesh and the
40
+ interpolated values of the field at the refined triangulation nodes.
41
+ """
42
+
43
+ def __init__(self, triangulation):
44
+ _api.check_isinstance(Triangulation, triangulation=triangulation)
45
+ self._triangulation = triangulation
46
+
47
+
48
+ class UniformTriRefiner(TriRefiner):
49
+ """
50
+ Uniform mesh refinement by recursive subdivisions.
51
+
52
+ Parameters
53
+ ----------
54
+ triangulation : `~matplotlib.tri.Triangulation`
55
+ The encapsulated triangulation (to be refined)
56
+ """
57
+ # See Also
58
+ # --------
59
+ # :class:`~matplotlib.tri.CubicTriInterpolator` and
60
+ # :class:`~matplotlib.tri.TriAnalyzer`.
61
+ # """
62
+ def __init__(self, triangulation):
63
+ super().__init__(triangulation)
64
+
65
+ def refine_triangulation(self, return_tri_index=False, subdiv=3):
66
+ """
67
+ Compute a uniformly refined triangulation *refi_triangulation* of
68
+ the encapsulated :attr:`!triangulation`.
69
+
70
+ This function refines the encapsulated triangulation by splitting each
71
+ father triangle into 4 child sub-triangles built on the edges midside
72
+ nodes, recursing *subdiv* times. In the end, each triangle is hence
73
+ divided into ``4**subdiv`` child triangles.
74
+
75
+ Parameters
76
+ ----------
77
+ return_tri_index : bool, default: False
78
+ Whether an index table indicating the father triangle index of each
79
+ point is returned.
80
+ subdiv : int, default: 3
81
+ Recursion level for the subdivision.
82
+ Each triangle is divided into ``4**subdiv`` child triangles;
83
+ hence, the default results in 64 refined subtriangles for each
84
+ triangle of the initial triangulation.
85
+
86
+ Returns
87
+ -------
88
+ refi_triangulation : `~matplotlib.tri.Triangulation`
89
+ The refined triangulation.
90
+ found_index : int array
91
+ Index of the initial triangulation containing triangle, for each
92
+ point of *refi_triangulation*.
93
+ Returned only if *return_tri_index* is set to True.
94
+ """
95
+ refi_triangulation = self._triangulation
96
+ ntri = refi_triangulation.triangles.shape[0]
97
+
98
+ # Computes the triangulation ancestors numbers in the reference
99
+ # triangulation.
100
+ ancestors = np.arange(ntri, dtype=np.int32)
101
+ for _ in range(subdiv):
102
+ refi_triangulation, ancestors = self._refine_triangulation_once(
103
+ refi_triangulation, ancestors)
104
+ refi_npts = refi_triangulation.x.shape[0]
105
+ refi_triangles = refi_triangulation.triangles
106
+
107
+ # Now we compute found_index table if needed
108
+ if return_tri_index:
109
+ # We have to initialize found_index with -1 because some nodes
110
+ # may very well belong to no triangle at all, e.g., in case of
111
+ # Delaunay Triangulation with DuplicatePointWarning.
112
+ found_index = np.full(refi_npts, -1, dtype=np.int32)
113
+ tri_mask = self._triangulation.mask
114
+ if tri_mask is None:
115
+ found_index[refi_triangles] = np.repeat(ancestors,
116
+ 3).reshape(-1, 3)
117
+ else:
118
+ # There is a subtlety here: we want to avoid whenever possible
119
+ # that refined points container is a masked triangle (which
120
+ # would result in artifacts in plots).
121
+ # So we impose the numbering from masked ancestors first,
122
+ # then overwrite it with unmasked ancestor numbers.
123
+ ancestor_mask = tri_mask[ancestors]
124
+ found_index[refi_triangles[ancestor_mask, :]
125
+ ] = np.repeat(ancestors[ancestor_mask],
126
+ 3).reshape(-1, 3)
127
+ found_index[refi_triangles[~ancestor_mask, :]
128
+ ] = np.repeat(ancestors[~ancestor_mask],
129
+ 3).reshape(-1, 3)
130
+ return refi_triangulation, found_index
131
+ else:
132
+ return refi_triangulation
133
+
134
+ def refine_field(self, z, triinterpolator=None, subdiv=3):
135
+ """
136
+ Refine a field defined on the encapsulated triangulation.
137
+
138
+ Parameters
139
+ ----------
140
+ z : (npoints,) array-like
141
+ Values of the field to refine, defined at the nodes of the
142
+ encapsulated triangulation. (``n_points`` is the number of points
143
+ in the initial triangulation)
144
+ triinterpolator : `~matplotlib.tri.TriInterpolator`, optional
145
+ Interpolator used for field interpolation. If not specified,
146
+ a `~matplotlib.tri.CubicTriInterpolator` will be used.
147
+ subdiv : int, default: 3
148
+ Recursion level for the subdivision.
149
+ Each triangle is divided into ``4**subdiv`` child triangles.
150
+
151
+ Returns
152
+ -------
153
+ refi_tri : `~matplotlib.tri.Triangulation`
154
+ The returned refined triangulation.
155
+ refi_z : 1D array of length: *refi_tri* node count.
156
+ The returned interpolated field (at *refi_tri* nodes).
157
+ """
158
+ if triinterpolator is None:
159
+ interp = matplotlib.tri.CubicTriInterpolator(
160
+ self._triangulation, z)
161
+ else:
162
+ _api.check_isinstance(matplotlib.tri.TriInterpolator,
163
+ triinterpolator=triinterpolator)
164
+ interp = triinterpolator
165
+
166
+ refi_tri, found_index = self.refine_triangulation(
167
+ subdiv=subdiv, return_tri_index=True)
168
+ refi_z = interp._interpolate_multikeys(
169
+ refi_tri.x, refi_tri.y, tri_index=found_index)[0]
170
+ return refi_tri, refi_z
171
+
172
+ @staticmethod
173
+ def _refine_triangulation_once(triangulation, ancestors=None):
174
+ """
175
+ Refine a `.Triangulation` by splitting each triangle into 4
176
+ child-masked_triangles built on the edges midside nodes.
177
+
178
+ Masked triangles, if present, are also split, but their children
179
+ returned masked.
180
+
181
+ If *ancestors* is not provided, returns only a new triangulation:
182
+ child_triangulation.
183
+
184
+ If the array-like key table *ancestor* is given, it shall be of shape
185
+ (ntri,) where ntri is the number of *triangulation* masked_triangles.
186
+ In this case, the function returns
187
+ (child_triangulation, child_ancestors)
188
+ child_ancestors is defined so that the 4 child masked_triangles share
189
+ the same index as their father: child_ancestors.shape = (4 * ntri,).
190
+ """
191
+
192
+ x = triangulation.x
193
+ y = triangulation.y
194
+
195
+ # According to tri.triangulation doc:
196
+ # neighbors[i, j] is the triangle that is the neighbor
197
+ # to the edge from point index masked_triangles[i, j] to point
198
+ # index masked_triangles[i, (j+1)%3].
199
+ neighbors = triangulation.neighbors
200
+ triangles = triangulation.triangles
201
+ npts = np.shape(x)[0]
202
+ ntri = np.shape(triangles)[0]
203
+ if ancestors is not None:
204
+ ancestors = np.asarray(ancestors)
205
+ if np.shape(ancestors) != (ntri,):
206
+ raise ValueError(
207
+ "Incompatible shapes provide for "
208
+ "triangulation.masked_triangles and ancestors: "
209
+ f"{np.shape(triangles)} and {np.shape(ancestors)}")
210
+
211
+ # Initiating tables refi_x and refi_y of the refined triangulation
212
+ # points
213
+ # hint: each apex is shared by 2 masked_triangles except the borders.
214
+ borders = np.sum(neighbors == -1)
215
+ added_pts = (3*ntri + borders) // 2
216
+ refi_npts = npts + added_pts
217
+ refi_x = np.zeros(refi_npts)
218
+ refi_y = np.zeros(refi_npts)
219
+
220
+ # First part of refi_x, refi_y is just the initial points
221
+ refi_x[:npts] = x
222
+ refi_y[:npts] = y
223
+
224
+ # Second part contains the edge midside nodes.
225
+ # Each edge belongs to 1 triangle (if border edge) or is shared by 2
226
+ # masked_triangles (interior edge).
227
+ # We first build 2 * ntri arrays of edge starting nodes (edge_elems,
228
+ # edge_apexes); we then extract only the masters to avoid overlaps.
229
+ # The so-called 'master' is the triangle with biggest index
230
+ # The 'slave' is the triangle with lower index
231
+ # (can be -1 if border edge)
232
+ # For slave and master we will identify the apex pointing to the edge
233
+ # start
234
+ edge_elems = np.tile(np.arange(ntri, dtype=np.int32), 3)
235
+ edge_apexes = np.repeat(np.arange(3, dtype=np.int32), ntri)
236
+ edge_neighbors = neighbors[edge_elems, edge_apexes]
237
+ mask_masters = (edge_elems > edge_neighbors)
238
+
239
+ # Identifying the "masters" and adding to refi_x, refi_y vec
240
+ masters = edge_elems[mask_masters]
241
+ apex_masters = edge_apexes[mask_masters]
242
+ x_add = (x[triangles[masters, apex_masters]] +
243
+ x[triangles[masters, (apex_masters+1) % 3]]) * 0.5
244
+ y_add = (y[triangles[masters, apex_masters]] +
245
+ y[triangles[masters, (apex_masters+1) % 3]]) * 0.5
246
+ refi_x[npts:] = x_add
247
+ refi_y[npts:] = y_add
248
+
249
+ # Building the new masked_triangles; each old masked_triangles hosts
250
+ # 4 new masked_triangles
251
+ # there are 6 pts to identify per 'old' triangle, 3 new_pt_corner and
252
+ # 3 new_pt_midside
253
+ new_pt_corner = triangles
254
+
255
+ # What is the index in refi_x, refi_y of point at middle of apex iapex
256
+ # of elem ielem ?
257
+ # If ielem is the apex master: simple count, given the way refi_x was
258
+ # built.
259
+ # If ielem is the apex slave: yet we do not know; but we will soon
260
+ # using the neighbors table.
261
+ new_pt_midside = np.empty([ntri, 3], dtype=np.int32)
262
+ cum_sum = npts
263
+ for imid in range(3):
264
+ mask_st_loc = (imid == apex_masters)
265
+ n_masters_loc = np.sum(mask_st_loc)
266
+ elem_masters_loc = masters[mask_st_loc]
267
+ new_pt_midside[:, imid][elem_masters_loc] = np.arange(
268
+ n_masters_loc, dtype=np.int32) + cum_sum
269
+ cum_sum += n_masters_loc
270
+
271
+ # Now dealing with slave elems.
272
+ # for each slave element we identify the master and then the inode
273
+ # once slave_masters is identified, slave_masters_apex is such that:
274
+ # neighbors[slaves_masters, slave_masters_apex] == slaves
275
+ mask_slaves = np.logical_not(mask_masters)
276
+ slaves = edge_elems[mask_slaves]
277
+ slaves_masters = edge_neighbors[mask_slaves]
278
+ diff_table = np.abs(neighbors[slaves_masters, :] -
279
+ np.outer(slaves, np.ones(3, dtype=np.int32)))
280
+ slave_masters_apex = np.argmin(diff_table, axis=1)
281
+ slaves_apex = edge_apexes[mask_slaves]
282
+ new_pt_midside[slaves, slaves_apex] = new_pt_midside[
283
+ slaves_masters, slave_masters_apex]
284
+
285
+ # Builds the 4 child masked_triangles
286
+ child_triangles = np.empty([ntri*4, 3], dtype=np.int32)
287
+ child_triangles[0::4, :] = np.vstack([
288
+ new_pt_corner[:, 0], new_pt_midside[:, 0],
289
+ new_pt_midside[:, 2]]).T
290
+ child_triangles[1::4, :] = np.vstack([
291
+ new_pt_corner[:, 1], new_pt_midside[:, 1],
292
+ new_pt_midside[:, 0]]).T
293
+ child_triangles[2::4, :] = np.vstack([
294
+ new_pt_corner[:, 2], new_pt_midside[:, 2],
295
+ new_pt_midside[:, 1]]).T
296
+ child_triangles[3::4, :] = np.vstack([
297
+ new_pt_midside[:, 0], new_pt_midside[:, 1],
298
+ new_pt_midside[:, 2]]).T
299
+ child_triangulation = Triangulation(refi_x, refi_y, child_triangles)
300
+
301
+ # Builds the child mask
302
+ if triangulation.mask is not None:
303
+ child_triangulation.set_mask(np.repeat(triangulation.mask, 4))
304
+
305
+ if ancestors is None:
306
+ return child_triangulation
307
+ else:
308
+ return child_triangulation, np.repeat(ancestors, 4)