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,807 @@
1
+ # Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
2
+ # axis3d.py, original mplot3d version by John Porter
3
+ # Created: 23 Sep 2005
4
+ # Parts rewritten by Reinier Heeres <reinier@heeres.eu>
5
+
6
+ from dataclasses import dataclass
7
+ import inspect
8
+
9
+ import numpy as np
10
+
11
+ import matplotlib_rs as mpl
12
+ from matplotlib_rs import (
13
+ _api, artist, lines as mlines, _axis_py as maxis, patches as mpatches,
14
+ text as mtext, transforms as mtransforms, colors as mcolors)
15
+ from . import art3d, proj3d
16
+
17
+
18
+ def _move_from_center(coord, centers, deltas, axmask=(True, True, True)):
19
+ """
20
+ For each coordinate where *axmask* is True, move *coord* away from
21
+ *centers* by *deltas*.
22
+ """
23
+ coord = np.asarray(coord)
24
+ return coord + axmask * np.copysign(1, coord - centers) * deltas
25
+
26
+
27
+ def _tick_update_position(tick, tickxs, tickys, labelpos):
28
+ """Update tick line and label position and style."""
29
+
30
+ tick.label1.set_position(labelpos)
31
+ tick.label2.set_position(labelpos)
32
+ tick.tick1line.set_visible(True)
33
+ tick.tick2line.set_visible(False)
34
+ tick.tick1line.set_linestyle('-')
35
+ tick.tick1line.set_marker('')
36
+ tick.tick1line.set_data(tickxs, tickys)
37
+ tick.gridline.set_data([0], [0])
38
+
39
+
40
+ @dataclass
41
+ class _UpdatedArtists:
42
+ """
43
+ Class to supply artists that have been updated ready to draw.
44
+
45
+ We track the types of artists individually, because they need
46
+ different handling in the tightbox calculation.
47
+ """
48
+ line: mlines.Line2D = None
49
+ ticks: list = None
50
+ offset_text: mtext.Text = None
51
+ label: mtext.Text = None
52
+
53
+ def __iter__(self):
54
+ """Yield all updated artists in the correct order for drawing"""
55
+ if self.line is not None:
56
+ yield self.line
57
+ if self.ticks is not None:
58
+ for tick in self.ticks:
59
+ yield tick
60
+ if self.offset_text is not None:
61
+ yield self.offset_text
62
+ if self.label is not None:
63
+ yield self.label
64
+
65
+
66
+ class Axis(maxis.XAxis):
67
+ """An Axis class for the 3D plots."""
68
+ # These points from the unit cube make up the x, y and z-planes
69
+ _PLANES = (
70
+ (0, 3, 7, 4), (1, 2, 6, 5), # yz planes
71
+ (0, 1, 5, 4), (3, 2, 6, 7), # xz planes
72
+ (0, 1, 2, 3), (4, 5, 6, 7), # xy planes
73
+ )
74
+
75
+ # Some properties for the axes
76
+ _AXINFO = {
77
+ 'x': {'i': 0, 'tickdir': 1, 'juggled': (1, 0, 2)},
78
+ 'y': {'i': 1, 'tickdir': 0, 'juggled': (0, 1, 2)},
79
+ 'z': {'i': 2, 'tickdir': 0, 'juggled': (0, 2, 1)},
80
+ }
81
+
82
+ def _old_init(self, adir, v_intervalx, d_intervalx, axes, *args,
83
+ rotate_label=None, **kwargs):
84
+ return locals()
85
+
86
+ def _new_init(self, axes, *, rotate_label=None, **kwargs):
87
+ return locals()
88
+
89
+ def __init__(self, *args, **kwargs):
90
+ params = _api.select_matching_signature(
91
+ [self._old_init, self._new_init], *args, **kwargs)
92
+ if "adir" in params:
93
+ _api.warn_deprecated(
94
+ "3.6", message=f"The signature of 3D Axis constructors has "
95
+ f"changed in %(since)s; the new signature is "
96
+ f"{inspect.signature(type(self).__init__)}", pending=True)
97
+ if params["adir"] != self.axis_name:
98
+ raise ValueError(f"Cannot instantiate {type(self).__name__} "
99
+ f"with adir={params['adir']!r}")
100
+ axes = params["axes"]
101
+ rotate_label = params["rotate_label"]
102
+ args = params.get("args", ())
103
+ kwargs = params["kwargs"]
104
+
105
+ name = self.axis_name
106
+
107
+ self._label_position = 'default'
108
+ self._tick_position = 'default'
109
+
110
+ # This is a temporary member variable.
111
+ # Do not depend on this existing in future releases!
112
+ self._axinfo = self._AXINFO[name].copy()
113
+ # Common parts
114
+ self._axinfo.update({
115
+ 'label': {'va': 'center', 'ha': 'center',
116
+ 'rotation_mode': 'anchor'},
117
+ 'color': mpl.rcParams[f'axes3d.{name}axis.panecolor'],
118
+ 'tick': {
119
+ 'inward_factor': 0.2,
120
+ 'outward_factor': 0.1,
121
+ },
122
+ })
123
+
124
+ if mpl.rcParams['_internal.classic_mode']:
125
+ self._axinfo.update({
126
+ 'axisline': {'linewidth': 0.75, 'color': (0, 0, 0, 1)},
127
+ 'grid': {
128
+ 'color': (0.9, 0.9, 0.9, 1),
129
+ 'linewidth': 1.0,
130
+ 'linestyle': '-',
131
+ },
132
+ })
133
+ self._axinfo['tick'].update({
134
+ 'linewidth': {
135
+ True: mpl.rcParams['lines.linewidth'], # major
136
+ False: mpl.rcParams['lines.linewidth'], # minor
137
+ }
138
+ })
139
+ else:
140
+ self._axinfo.update({
141
+ 'axisline': {
142
+ 'linewidth': mpl.rcParams['axes.linewidth'],
143
+ 'color': mpl.rcParams['axes.edgecolor'],
144
+ },
145
+ 'grid': {
146
+ 'color': mpl.rcParams['grid.color'],
147
+ 'linewidth': mpl.rcParams['grid.linewidth'],
148
+ 'linestyle': mpl.rcParams['grid.linestyle'],
149
+ },
150
+ })
151
+ self._axinfo['tick'].update({
152
+ 'linewidth': {
153
+ True: ( # major
154
+ mpl.rcParams['xtick.major.width'] if name in 'xz'
155
+ else mpl.rcParams['ytick.major.width']),
156
+ False: ( # minor
157
+ mpl.rcParams['xtick.minor.width'] if name in 'xz'
158
+ else mpl.rcParams['ytick.minor.width']),
159
+ }
160
+ })
161
+
162
+ super().__init__(axes, *args, **kwargs)
163
+
164
+ # data and viewing intervals for this direction
165
+ if "d_intervalx" in params:
166
+ self.set_data_interval(*params["d_intervalx"])
167
+ if "v_intervalx" in params:
168
+ self.set_view_interval(*params["v_intervalx"])
169
+ self.set_rotate_label(rotate_label)
170
+ self._init3d() # Inline after init3d deprecation elapses.
171
+
172
+ __init__.__signature__ = inspect.signature(_new_init)
173
+ adir = _api.deprecated("3.6", pending=True)(
174
+ property(lambda self: self.axis_name))
175
+
176
+ def _init3d(self):
177
+ self.line = mlines.Line2D(
178
+ xdata=(0, 0), ydata=(0, 0),
179
+ linewidth=self._axinfo['axisline']['linewidth'],
180
+ color=self._axinfo['axisline']['color'],
181
+ antialiased=True)
182
+
183
+ # Store dummy data in Polygon object
184
+ self.pane = mpatches.Polygon([[0, 0], [0, 1]], closed=False)
185
+ self.set_pane_color(self._axinfo['color'])
186
+
187
+ self.axes._set_artist_props(self.line)
188
+ self.axes._set_artist_props(self.pane)
189
+ self.gridlines = art3d.Line3DCollection([])
190
+ self.axes._set_artist_props(self.gridlines)
191
+ self.axes._set_artist_props(self.label)
192
+ self.axes._set_artist_props(self.offsetText)
193
+ # Need to be able to place the label at the correct location
194
+ self.label._transform = self.axes.transData
195
+ self.offsetText._transform = self.axes.transData
196
+
197
+ @_api.deprecated("3.6", pending=True)
198
+ def init3d(self): # After deprecation elapses, inline _init3d to __init__.
199
+ self._init3d()
200
+
201
+ def get_major_ticks(self, numticks=None):
202
+ ticks = super().get_major_ticks(numticks)
203
+ for t in ticks:
204
+ for obj in [
205
+ t.tick1line, t.tick2line, t.gridline, t.label1, t.label2]:
206
+ obj.set_transform(self.axes.transData)
207
+ return ticks
208
+
209
+ def get_minor_ticks(self, numticks=None):
210
+ ticks = super().get_minor_ticks(numticks)
211
+ for t in ticks:
212
+ for obj in [
213
+ t.tick1line, t.tick2line, t.gridline, t.label1, t.label2]:
214
+ obj.set_transform(self.axes.transData)
215
+ return ticks
216
+
217
+ def set_ticks_position(self, position):
218
+ """
219
+ Set the ticks position.
220
+
221
+ Parameters
222
+ ----------
223
+ position : {'lower', 'upper', 'both', 'default', 'none'}
224
+ The position of the bolded axis lines, ticks, and tick labels.
225
+ """
226
+ _api.check_in_list(['lower', 'upper', 'both', 'default', 'none'],
227
+ position=position)
228
+ self._tick_position = position
229
+
230
+ def get_ticks_position(self):
231
+ """
232
+ Get the ticks position.
233
+
234
+ Returns
235
+ -------
236
+ str : {'lower', 'upper', 'both', 'default', 'none'}
237
+ The position of the bolded axis lines, ticks, and tick labels.
238
+ """
239
+ return self._tick_position
240
+
241
+ def set_label_position(self, position):
242
+ """
243
+ Set the label position.
244
+
245
+ Parameters
246
+ ----------
247
+ position : {'lower', 'upper', 'both', 'default', 'none'}
248
+ The position of the axis label.
249
+ """
250
+ _api.check_in_list(['lower', 'upper', 'both', 'default', 'none'],
251
+ position=position)
252
+ self._label_position = position
253
+
254
+ def get_label_position(self):
255
+ """
256
+ Get the label position.
257
+
258
+ Returns
259
+ -------
260
+ str : {'lower', 'upper', 'both', 'default', 'none'}
261
+ The position of the axis label.
262
+ """
263
+ return self._label_position
264
+
265
+ def set_pane_color(self, color, alpha=None):
266
+ """
267
+ Set pane color.
268
+
269
+ Parameters
270
+ ----------
271
+ color : :mpltype:`color`
272
+ Color for axis pane.
273
+ alpha : float, optional
274
+ Alpha value for axis pane. If None, base it on *color*.
275
+ """
276
+ color = mcolors.to_rgba(color, alpha)
277
+ self._axinfo['color'] = color
278
+ self.pane.set_edgecolor(color)
279
+ self.pane.set_facecolor(color)
280
+ self.pane.set_alpha(color[-1])
281
+ self.stale = True
282
+
283
+ def set_rotate_label(self, val):
284
+ """
285
+ Whether to rotate the axis label: True, False or None.
286
+ If set to None the label will be rotated if longer than 4 chars.
287
+ """
288
+ self._rotate_label = val
289
+ self.stale = True
290
+
291
+ def get_rotate_label(self, text):
292
+ if self._rotate_label is not None:
293
+ return self._rotate_label
294
+ else:
295
+ return len(text) > 4
296
+
297
+ def _get_coord_info(self):
298
+ # Get scaled limits directly from the axes helper
299
+ xmin, xmax, ymin, ymax, zmin, zmax = self.axes._get_scaled_limits()
300
+ # When axes are inverted the min and max values returned by _get_scaled_limits
301
+ # are reversed (min > max). Here we need to ensure max > min so that the axis
302
+ # lines and grid panes are placed consistently regardless of inversion.
303
+ # Note that we cannot ensure this inside _get_scaled_limits itself, as other
304
+ # callers rely on the signed range to detect and handle axis inversion.
305
+ mins = np.array([min(xmin, xmax), min(ymin, ymax), min(zmin, zmax)])
306
+ maxs = np.array([max(xmin, xmax), max(ymin, ymax), max(zmin, zmax)])
307
+
308
+ # Get data-space bounds for _transformed_cube
309
+ bounds = (*self.axes.get_xbound(),
310
+ *self.axes.get_ybound(),
311
+ *self.axes.get_zbound())
312
+ bounds_proj = self.axes._transformed_cube(bounds)
313
+
314
+ # Determine which one of the parallel planes are higher up:
315
+ means_z0 = np.zeros(3)
316
+ means_z1 = np.zeros(3)
317
+ for i in range(3):
318
+ means_z0[i] = np.mean(bounds_proj[self._PLANES[2 * i], 2])
319
+ means_z1[i] = np.mean(bounds_proj[self._PLANES[2 * i + 1], 2])
320
+ highs = means_z0 < means_z1
321
+
322
+ # Special handling for edge-on views
323
+ equals = np.abs(means_z0 - means_z1) <= np.finfo(float).eps
324
+ if np.sum(equals) == 2:
325
+ vertical = np.where(~equals)[0][0]
326
+ if vertical == 2: # looking at XY plane
327
+ highs = np.array([True, True, highs[2]])
328
+ elif vertical == 1: # looking at XZ plane
329
+ highs = np.array([True, highs[1], False])
330
+ elif vertical == 0: # looking at YZ plane
331
+ highs = np.array([highs[0], False, False])
332
+
333
+ return mins, maxs, bounds_proj, highs
334
+
335
+ def _calc_centers_deltas(self, maxs, mins):
336
+ centers = 0.5 * (maxs + mins)
337
+ # In mpl3.8, the scale factor was 1/12. mpl3.9 changes this to
338
+ # 1/12 * 24/25 = 0.08 to compensate for the change in automargin
339
+ # behavior and keep appearance the same. The 24/25 factor is from the
340
+ # 1/48 padding added to each side of the axis in mpl3.8.
341
+ scale = 0.08
342
+ deltas = (maxs - mins) * scale
343
+ return centers, deltas
344
+
345
+ def _get_axis_line_edge_points(self, minmax, maxmin, position=None):
346
+ """Get the edge points for the black bolded axis line."""
347
+ # When changing vertical axis some of the axes has to be
348
+ # moved to the other plane so it looks the same as if the z-axis
349
+ # was the vertical axis.
350
+ mb = [minmax, maxmin] # line from origin to nearest corner to camera
351
+ mb_rev = mb[::-1]
352
+ mm = [[mb, mb_rev, mb_rev], [mb_rev, mb_rev, mb], [mb, mb, mb]]
353
+ mm = mm[self.axes._vertical_axis][self._axinfo["i"]]
354
+
355
+ juggled = self._axinfo["juggled"]
356
+ edge_point_0 = mm[0].copy() # origin point
357
+
358
+ if ((position == 'lower' and mm[1][juggled[-1]] < mm[0][juggled[-1]]) or
359
+ (position == 'upper' and mm[1][juggled[-1]] > mm[0][juggled[-1]])):
360
+ edge_point_0[juggled[-1]] = mm[1][juggled[-1]]
361
+ else:
362
+ edge_point_0[juggled[0]] = mm[1][juggled[0]]
363
+
364
+ edge_point_1 = edge_point_0.copy()
365
+ edge_point_1[juggled[1]] = mm[1][juggled[1]]
366
+
367
+ return edge_point_0, edge_point_1
368
+
369
+ def _get_all_axis_line_edge_points(self, minmax, maxmin, axis_position=None):
370
+ # Determine edge points for the axis lines
371
+ edgep1s = []
372
+ edgep2s = []
373
+ position = []
374
+ if axis_position in (None, 'default'):
375
+ edgep1, edgep2 = self._get_axis_line_edge_points(minmax, maxmin)
376
+ edgep1s = [edgep1]
377
+ edgep2s = [edgep2]
378
+ position = ['default']
379
+ else:
380
+ edgep1_l, edgep2_l = self._get_axis_line_edge_points(minmax, maxmin,
381
+ position='lower')
382
+ edgep1_u, edgep2_u = self._get_axis_line_edge_points(minmax, maxmin,
383
+ position='upper')
384
+ if axis_position in ('lower', 'both'):
385
+ edgep1s.append(edgep1_l)
386
+ edgep2s.append(edgep2_l)
387
+ position.append('lower')
388
+ if axis_position in ('upper', 'both'):
389
+ edgep1s.append(edgep1_u)
390
+ edgep2s.append(edgep2_u)
391
+ position.append('upper')
392
+ return edgep1s, edgep2s, position
393
+
394
+ def _get_tickdir(self, position):
395
+ """
396
+ Get the direction of the tick.
397
+
398
+ Parameters
399
+ ----------
400
+ position : str, optional : {'upper', 'lower', 'default'}
401
+ The position of the axis.
402
+
403
+ Returns
404
+ -------
405
+ tickdir : int
406
+ Index which indicates which coordinate the tick line will
407
+ align with.
408
+ """
409
+ _api.check_in_list(('upper', 'lower', 'default'), position=position)
410
+
411
+ # TODO: Move somewhere else where it's triggered less:
412
+ tickdirs_base = [v["tickdir"] for v in self._AXINFO.values()] # default
413
+ elev_mod = np.mod(self.axes.elev + 180, 360) - 180
414
+ azim_mod = np.mod(self.axes.azim, 360)
415
+ if position == 'upper':
416
+ if elev_mod >= 0:
417
+ tickdirs_base = [2, 2, 0]
418
+ else:
419
+ tickdirs_base = [1, 0, 0]
420
+ if 0 <= azim_mod < 180:
421
+ tickdirs_base[2] = 1
422
+ elif position == 'lower':
423
+ if elev_mod >= 0:
424
+ tickdirs_base = [1, 0, 1]
425
+ else:
426
+ tickdirs_base = [2, 2, 1]
427
+ if 0 <= azim_mod < 180:
428
+ tickdirs_base[2] = 0
429
+ info_i = [v["i"] for v in self._AXINFO.values()]
430
+
431
+ i = self._axinfo["i"]
432
+ vert_ax = self.axes._vertical_axis
433
+ j = vert_ax - 2
434
+ # default: tickdir = [[1, 2, 1], [2, 2, 0], [1, 0, 0]][vert_ax][i]
435
+ tickdir = np.roll(info_i, -j)[np.roll(tickdirs_base, j)][i]
436
+ return tickdir
437
+
438
+ def active_pane(self):
439
+ mins, maxs, tc, highs = self._get_coord_info()
440
+ info = self._axinfo
441
+ index = info['i']
442
+ if not highs[index]:
443
+ loc = mins[index]
444
+ plane = self._PLANES[2 * index]
445
+ else:
446
+ loc = maxs[index]
447
+ plane = self._PLANES[2 * index + 1]
448
+ xys = np.array([tc[p] for p in plane])
449
+ return xys, loc
450
+
451
+ def draw_pane(self, renderer):
452
+ """
453
+ Draw pane.
454
+
455
+ Parameters
456
+ ----------
457
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass
458
+ """
459
+ renderer.open_group('pane3d', gid=self.get_gid())
460
+ xys, loc = self.active_pane()
461
+ self.pane.xy = xys[:, :2]
462
+ self.pane.draw(renderer)
463
+ renderer.close_group('pane3d')
464
+
465
+ def _axmask(self):
466
+ axmask = [True, True, True]
467
+ axmask[self._axinfo["i"]] = False
468
+ return axmask
469
+
470
+ def _get_updated_ticks(self, edgep1, centers, deltas, highs,
471
+ deltas_per_point, pos):
472
+ """Update the ticks ready for draw and return in a list."""
473
+ ticks = self._update_ticks()
474
+ info = self._axinfo
475
+ index = info["i"]
476
+ juggled = info["juggled"]
477
+
478
+ mins, maxs, tc, highs = self._get_coord_info()
479
+ centers, deltas = self._calc_centers_deltas(maxs, mins)
480
+
481
+ # Get the scale transform for this axis to transform tick locations
482
+ axis = [self.axes.xaxis, self.axes.yaxis, self.axes.zaxis][index]
483
+ axis_trans = axis.get_transform()
484
+
485
+ # Update ticks:
486
+ tickdir = self._get_tickdir(pos)
487
+ tickdelta = deltas[tickdir] if highs[tickdir] else -deltas[tickdir]
488
+
489
+ tick_info = info['tick']
490
+ tick_out = tick_info['outward_factor'] * tickdelta
491
+ tick_in = tick_info['inward_factor'] * tickdelta
492
+ tick_lw = tick_info['linewidth']
493
+ edgep1_tickdir = edgep1[tickdir]
494
+ out_tickdir = edgep1_tickdir + tick_out
495
+ in_tickdir = edgep1_tickdir - tick_in
496
+
497
+ default_label_offset = 8. # A rough estimate
498
+ points = deltas_per_point * deltas
499
+ # All coordinates below are in transformed coordinates for proper projection
500
+ for tick in ticks:
501
+ # Get tick line positions
502
+ pos = edgep1.copy()
503
+ pos[index] = axis_trans.transform([tick.get_loc()])[0]
504
+ pos[tickdir] = out_tickdir
505
+ x1, y1, z1 = proj3d.proj_transform(*pos, self.axes.M)
506
+ pos[tickdir] = in_tickdir
507
+ x2, y2, z2 = proj3d.proj_transform(*pos, self.axes.M)
508
+
509
+ # Get position of label
510
+ labeldeltas = (tick.get_pad() + default_label_offset) * points
511
+ pos[tickdir] = edgep1_tickdir
512
+ pos = _move_from_center(pos, centers, labeldeltas, self._axmask())
513
+ lx, ly, lz = proj3d.proj_transform(*pos, self.axes.M)
514
+
515
+ _tick_update_position(tick, (x1, x2), (y1, y2), (lx, ly))
516
+ tick.tick1line.set_linewidth(tick_lw[tick._major])
517
+
518
+ return ticks
519
+
520
+ def _update_offset_text(self, edgep1, edgep2, labeldeltas, centers,
521
+ highs, pep, dx, dy):
522
+ """Update the offset text ready to draw."""
523
+ # Get general axis information:
524
+ info = self._axinfo
525
+ index = info["i"]
526
+ juggled = info["juggled"]
527
+ tickdir = info["tickdir"]
528
+
529
+ # Which of the two edge points do we want to
530
+ # use for locating the offset text?
531
+ if juggled[2] == 2:
532
+ outeredgep = edgep1
533
+ outerindex = 0
534
+ else:
535
+ outeredgep = edgep2
536
+ outerindex = 1
537
+
538
+ pos = _move_from_center(outeredgep, centers, labeldeltas,
539
+ self._axmask())
540
+ olx, oly, olz = proj3d.proj_transform(*pos, self.axes.M)
541
+ self.offsetText.set_text(self.major.formatter.get_offset())
542
+ self.offsetText.set_position((olx, oly))
543
+ angle = art3d._norm_text_angle(np.rad2deg(np.arctan2(dy, dx)))
544
+ self.offsetText.set_rotation(angle)
545
+ # Must set rotation mode to "anchor" so that
546
+ # the alignment point is used as the "fulcrum" for rotation.
547
+ self.offsetText.set_rotation_mode('anchor')
548
+
549
+ # ----------------------------------------------------------------------
550
+ # Note: the following statement for determining the proper alignment of
551
+ # the offset text. This was determined entirely by trial-and-error
552
+ # and should not be in any way considered as "the way". There are
553
+ # still some edge cases where alignment is not quite right, but this
554
+ # seems to be more of a geometry issue (in other words, I might be
555
+ # using the wrong reference points).
556
+ #
557
+ # (TT, FF, TF, FT) are the shorthand for the tuple of
558
+ # (centpt[tickdir] <= pep[tickdir, outerindex],
559
+ # centpt[index] <= pep[index, outerindex])
560
+ #
561
+ # Three-letters (e.g., TFT, FTT) are short-hand for the array of bools
562
+ # from the variable 'highs'.
563
+ # ---------------------------------------------------------------------
564
+ centpt = proj3d.proj_transform(*centers, self.axes.M)
565
+ if centpt[tickdir] > pep[tickdir, outerindex]:
566
+ # if FT and if highs has an even number of Trues
567
+ if (centpt[index] <= pep[index, outerindex]
568
+ and np.count_nonzero(highs) % 2 == 0):
569
+ # Usually, this means align right, except for the FTT case,
570
+ # in which offset for axis 1 and 2 are aligned left.
571
+ if highs.tolist() == [False, True, True] and index in (1, 2):
572
+ align = 'left'
573
+ else:
574
+ align = 'right'
575
+ else:
576
+ # The FF case
577
+ align = 'left'
578
+ else:
579
+ # if TF and if highs has an even number of Trues
580
+ if (centpt[index] > pep[index, outerindex]
581
+ and np.count_nonzero(highs) % 2 == 0):
582
+ # Usually mean align left, except if it is axis 2
583
+ align = 'right' if index == 2 else 'left'
584
+ else:
585
+ # The TT case
586
+ align = 'right'
587
+
588
+ self.offsetText.set_va('center')
589
+ self.offsetText.set_ha(align)
590
+
591
+ def _update_label_position(self, edgep1, edgep2, labeldeltas, centers, dx, dy):
592
+ """Update the axis label position ready to draw."""
593
+ label = self._axinfo["label"]
594
+
595
+ lxyz = 0.5 * (edgep1 + edgep2)
596
+ lxyz = _move_from_center(lxyz, centers, labeldeltas, self._axmask())
597
+ tlx, tly, tlz = proj3d.proj_transform(*lxyz, self.axes.M)
598
+ self.label.set_position((tlx, tly))
599
+ if self.get_rotate_label(self.label.get_text()):
600
+ angle = art3d._norm_text_angle(np.rad2deg(np.arctan2(dy, dx)))
601
+ self.label.set_rotation(angle)
602
+ self.label.set_va(label['va'])
603
+ self.label.set_ha(label['ha'])
604
+ self.label.set_rotation_mode(label['rotation_mode'])
605
+
606
+ def _update_all_positions(self):
607
+ """
608
+ Update positions of all child artists ready to draw. Artists may be drawn
609
+ twice: if tick_position is 'both', the ticks, line and offset text show on both
610
+ sides of the axes; if label_position is 'both' the label shows on both sides.
611
+ Since tightbox calculation needs individual handling of the different Artist
612
+ types, we return them through the dataclass `_UpdatedArtists` (as opposed to a
613
+ plain list).
614
+ Since we reuse the same artists with different positions, the calling function
615
+ requires them after every position update, so we yield `_UpdatedArtists` up to
616
+ four times with different content:
617
+
618
+ - line, ticks, offset_text on one side
619
+ - line, ticks, offset_text on the other side
620
+ - label on one side
621
+ - label on the other side
622
+ """
623
+ self.label._transform = self.axes.transData
624
+ self.offsetText._transform = self.axes.transData
625
+
626
+ # Get general axis information:
627
+ mins, maxs, tc, highs = self._get_coord_info()
628
+ centers, deltas = self._calc_centers_deltas(maxs, mins)
629
+
630
+ # Calculate offset distances
631
+ # A rough estimate; points are ambiguous since 3D plots rotate
632
+ reltoinches = self.get_figure(root=False).dpi_scale_trans.inverted()
633
+ ax_inches = reltoinches.transform(self.axes.bbox.size)
634
+ ax_points_estimate = sum(72. * ax_inches)
635
+ deltas_per_point = 48 / ax_points_estimate
636
+ default_offset = 21.
637
+ labeldeltas = (self.labelpad + default_offset) * deltas_per_point * deltas
638
+
639
+ # Determine edge points for the axis lines
640
+ minmax = np.where(highs, maxs, mins) # "origin" point
641
+ maxmin = np.where(~highs, maxs, mins) # "opposite" corner near camera
642
+
643
+ for edgep1, edgep2, pos in zip(*self._get_all_axis_line_edge_points(
644
+ minmax, maxmin, self._tick_position)):
645
+ # Project the edge points along the current position
646
+ pep = proj3d._proj_trans_points([edgep1, edgep2], self.axes.M)
647
+ pep = np.asarray(pep)
648
+
649
+ # The transAxes transform is used because the Text object
650
+ # rotates the text relative to the display coordinate system.
651
+ # Therefore, if we want the labels to remain parallel to the
652
+ # axis regardless of the aspect ratio, we need to convert the
653
+ # edge points of the plane to display coordinates and calculate
654
+ # an angle from that.
655
+ # TODO: Maybe Text objects should handle this themselves?
656
+ dx, dy = (self.axes.transAxes.transform([pep[0:2, 1]]) -
657
+ self.axes.transAxes.transform([pep[0:2, 0]]))[0]
658
+
659
+ # Handle the lines
660
+ self.line.set_data(pep[0], pep[1])
661
+
662
+ # Handle ticks
663
+ ticks = self._get_updated_ticks(
664
+ edgep1, centers, deltas, highs, deltas_per_point, pos)
665
+
666
+ # Handle Offset text
667
+ self._update_offset_text(
668
+ edgep1, edgep2, labeldeltas, centers, highs, pep, dx, dy)
669
+
670
+ yield _UpdatedArtists(line=self.line, ticks=ticks,
671
+ offset_text=self.offsetText)
672
+
673
+ if self.label.get_visible() and self.label.get_text():
674
+ # Handle label
675
+ for edgep1, edgep2, pos in zip(*self._get_all_axis_line_edge_points(
676
+ minmax, maxmin, self._label_position)):
677
+ # See comments above
678
+ pep = proj3d._proj_trans_points([edgep1, edgep2], self.axes.M)
679
+ pep = np.asarray(pep)
680
+ dx, dy = (self.axes.transAxes.transform([pep[0:2, 1]]) -
681
+ self.axes.transAxes.transform([pep[0:2, 0]]))[0]
682
+
683
+ self._update_label_position(
684
+ edgep1, edgep2, labeldeltas, centers, dx, dy)
685
+
686
+ yield _UpdatedArtists(label=self.label)
687
+
688
+ @artist.allow_rasterization
689
+ def draw(self, renderer):
690
+ renderer.open_group('axis3d', gid=self.get_gid())
691
+
692
+ for updated_artists in self._update_all_positions():
693
+ for art in updated_artists:
694
+ art.draw(renderer)
695
+
696
+ renderer.close_group('axis3d')
697
+ self.stale = False
698
+
699
+ @artist.allow_rasterization
700
+ def draw_grid(self, renderer):
701
+ if not self.axes._draw_grid:
702
+ return
703
+
704
+ renderer.open_group("grid3d", gid=self.get_gid())
705
+
706
+ ticks = self._update_ticks()
707
+ if len(ticks):
708
+ # Get general axis information:
709
+ info = self._axinfo
710
+ index = info["i"]
711
+
712
+ # Grid lines use data-space bounds (Line3DCollection applies transforms)
713
+ mins, maxs, tc, highs = self._get_coord_info()
714
+ xlim, ylim, zlim = (self.axes.get_xbound(),
715
+ self.axes.get_ybound(),
716
+ self.axes.get_zbound())
717
+ data_mins = np.array([xlim[0], ylim[0], zlim[0]])
718
+ data_maxs = np.array([xlim[1], ylim[1], zlim[1]])
719
+ minmax = np.where(highs, data_maxs, data_mins)
720
+ maxmin = np.where(~highs, data_maxs, data_mins)
721
+
722
+ # Grid points where the planes meet
723
+ xyz0 = np.tile(minmax, (len(ticks), 1))
724
+ xyz0[:, index] = [tick.get_loc() for tick in ticks]
725
+
726
+ # Grid lines go from the end of one plane through the plane
727
+ # intersection (at xyz0) to the end of the other plane. The first
728
+ # point (0) differs along dimension index-2 and the last (2) along
729
+ # dimension index-1.
730
+ lines = np.stack([xyz0, xyz0, xyz0], axis=1)
731
+ lines[:, 0, index - 2] = maxmin[index - 2]
732
+ lines[:, 2, index - 1] = maxmin[index - 1]
733
+ self.gridlines.set_segments(lines)
734
+ gridinfo = info['grid']
735
+ self.gridlines.set_color(gridinfo['color'])
736
+ self.gridlines.set_linewidth(gridinfo['linewidth'])
737
+ self.gridlines.set_linestyle(gridinfo['linestyle'])
738
+ self.gridlines.do_3d_projection()
739
+ self.gridlines.draw(renderer)
740
+
741
+ renderer.close_group('grid3d')
742
+
743
+ # TODO: Get this to work (more) properly when mplot3d supports the
744
+ # transforms framework.
745
+ def get_tightbbox(self, renderer=None, *, for_layout_only=False):
746
+ # docstring inherited
747
+ if not self.get_visible():
748
+ return
749
+
750
+ if self.axes.M is None:
751
+ self.axes.M = self.axes.get_proj()
752
+ self.axes.invM = np.linalg.inv(self.axes.M)
753
+
754
+ bboxes = []
755
+
756
+ for updated_artists in self._update_all_positions():
757
+ if (ticks := updated_artists.ticks) is not None:
758
+ for tlabel_bbs in self._get_ticklabel_bboxes(ticks, renderer):
759
+ bboxes.extend(tlabel_bbs)
760
+
761
+ if (line := updated_artists.line) is not None and line.get_visible():
762
+ bboxes.append(line.get_window_extent(renderer))
763
+
764
+ if ((offset_text := updated_artists.offset_text) is not None and
765
+ offset_text.get_visible() and offset_text.get_text()):
766
+ bboxes.append(offset_text.get_window_extent(renderer))
767
+
768
+ if updated_artists.label is not None and not for_layout_only:
769
+ bboxes.append(updated_artists.label.get_window_extent(renderer))
770
+
771
+ if bboxes:
772
+ return mtransforms.Bbox.union(bboxes)
773
+ else:
774
+ return None
775
+
776
+ d_interval = _api.deprecated(
777
+ "3.6", alternative="get_data_interval", pending=True)(
778
+ property(lambda self: self.get_data_interval(),
779
+ lambda self, minmax: self.set_data_interval(*minmax)))
780
+ v_interval = _api.deprecated(
781
+ "3.6", alternative="get_view_interval", pending=True)(
782
+ property(lambda self: self.get_view_interval(),
783
+ lambda self, minmax: self.set_view_interval(*minmax)))
784
+
785
+
786
+ class XAxis(Axis):
787
+ axis_name = "x"
788
+ get_view_interval, set_view_interval = maxis._make_getset_interval(
789
+ "view", "xy_viewLim", "intervalx")
790
+ get_data_interval, set_data_interval = maxis._make_getset_interval(
791
+ "data", "xy_dataLim", "intervalx")
792
+
793
+
794
+ class YAxis(Axis):
795
+ axis_name = "y"
796
+ get_view_interval, set_view_interval = maxis._make_getset_interval(
797
+ "view", "xy_viewLim", "intervaly")
798
+ get_data_interval, set_data_interval = maxis._make_getset_interval(
799
+ "data", "xy_dataLim", "intervaly")
800
+
801
+
802
+ class ZAxis(Axis):
803
+ axis_name = "z"
804
+ get_view_interval, set_view_interval = maxis._make_getset_interval(
805
+ "view", "zz_viewLim", "intervalx")
806
+ get_data_interval, set_data_interval = maxis._make_getset_interval(
807
+ "data", "zz_dataLim", "intervalx")