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.
- docs/releases/0.0.1.md +268 -0
- docs/releases/0.0.2.md +69 -0
- docs/releases/0.0.3.md +80 -0
- docs/releases/0.0.4.md +73 -0
- docs/releases/0.0.5.md +24 -0
- docs/releases/0.0.6.md +24 -0
- docs/releases/0.0.7.md +24 -0
- docs/releases/0.0.8.md +16 -0
- licenses/LICENSE_CONTOURPY +29 -0
- licenses/LICENSE_CYCLER +27 -0
- licenses/LICENSE_DATEUTIL +54 -0
- licenses/LICENSE_KIWISOLVER +71 -0
- licenses/LICENSE_LIBWEBP +56 -0
- licenses/LICENSE_MATPLOTLIB +1253 -0
- licenses/LICENSE_PYPARSING +20 -0
- licenses/LICENSE_QHULL +39 -0
- licenses/LICENSE_SIX +18 -0
- matplotlib_rs/__init__.py +1683 -0
- matplotlib_rs/__main__.py +27 -0
- matplotlib_rs/_afm.py +500 -0
- matplotlib_rs/_animation_data.py +263 -0
- matplotlib_rs/_api/__init__.py +495 -0
- matplotlib_rs/_api/deprecation.py +534 -0
- matplotlib_rs/_axis_py.py +2991 -0
- matplotlib_rs/_blocking_input.py +31 -0
- matplotlib_rs/_cm.py +1500 -0
- matplotlib_rs/_cm_bivar.py +1289 -0
- matplotlib_rs/_cm_listed.py +2848 -0
- matplotlib_rs/_cm_multivar.py +167 -0
- matplotlib_rs/_color_data.py +1142 -0
- matplotlib_rs/_colormap.py +132 -0
- matplotlib_rs/_constrained_layout.py +825 -0
- matplotlib_rs/_contour.py +108 -0
- matplotlib_rs/_doc_cache.py +12214 -0
- matplotlib_rs/_docstring.py +142 -0
- matplotlib_rs/_enums.py +178 -0
- matplotlib_rs/_figure_rs.py +294 -0
- matplotlib_rs/_fontconfig_pattern.py +129 -0
- matplotlib_rs/_foreign.py +220 -0
- matplotlib_rs/_hook.py +94 -0
- matplotlib_rs/_image.py +160 -0
- matplotlib_rs/_imageio.py +229 -0
- matplotlib_rs/_internal_utils.py +65 -0
- matplotlib_rs/_kiwi.py +484 -0
- matplotlib_rs/_layoutgrid.py +549 -0
- matplotlib_rs/_live.py +192 -0
- matplotlib_rs/_mathtext.py +3103 -0
- matplotlib_rs/_mathtext_data.py +1811 -0
- matplotlib_rs/_mplrs.cp315-win_amd64.pyd +0 -0
- matplotlib_rs/_path.py +25 -0
- matplotlib_rs/_png.py +162 -0
- matplotlib_rs/_pylab_helpers.py +137 -0
- matplotlib_rs/_qhull.py +66 -0
- matplotlib_rs/_rcpush.py +84 -0
- matplotlib_rs/_spines_rs.py +108 -0
- matplotlib_rs/_style_helpers.py +52 -0
- matplotlib_rs/_text_helpers.py +51 -0
- matplotlib_rs/_tight_bbox.py +85 -0
- matplotlib_rs/_tight_layout.py +302 -0
- matplotlib_rs/_tri.py +140 -0
- matplotlib_rs/_type1font.py +1228 -0
- matplotlib_rs/_vendor/__init__.py +8 -0
- matplotlib_rs/_vendor/cycler.py +574 -0
- matplotlib_rs/_vendor/dateutil/__init__.py +27 -0
- matplotlib_rs/_vendor/dateutil/_common.py +44 -0
- matplotlib_rs/_vendor/dateutil/_tzdata_impl.py +148 -0
- matplotlib_rs/_vendor/dateutil/_version.py +5 -0
- matplotlib_rs/_vendor/dateutil/easter.py +90 -0
- matplotlib_rs/_vendor/dateutil/parser/__init__.py +62 -0
- matplotlib_rs/_vendor/dateutil/parser/_parser.py +1614 -0
- matplotlib_rs/_vendor/dateutil/parser/isoparser.py +417 -0
- matplotlib_rs/_vendor/dateutil/relativedelta.py +597 -0
- matplotlib_rs/_vendor/dateutil/rrule.py +1765 -0
- matplotlib_rs/_vendor/dateutil/tz/__init__.py +61 -0
- matplotlib_rs/_vendor/dateutil/tz/_common.py +420 -0
- matplotlib_rs/_vendor/dateutil/tz/_factories.py +81 -0
- matplotlib_rs/_vendor/dateutil/tz/_tzfile.py +1429 -0
- matplotlib_rs/_vendor/dateutil/tz/_tzpath.py +105 -0
- matplotlib_rs/_vendor/dateutil/tz/tz.py +1473 -0
- matplotlib_rs/_vendor/dateutil/tz/win.py +371 -0
- matplotlib_rs/_vendor/dateutil/tzwin.py +3 -0
- matplotlib_rs/_vendor/dateutil/utils.py +72 -0
- matplotlib_rs/_vendor/dateutil/zoneinfo/__init__.py +234 -0
- matplotlib_rs/_vendor/pyparsing/__init__.py +414 -0
- matplotlib_rs/_vendor/pyparsing/actions.py +265 -0
- matplotlib_rs/_vendor/pyparsing/common.py +571 -0
- matplotlib_rs/_vendor/pyparsing/core.py +6973 -0
- matplotlib_rs/_vendor/pyparsing/exceptions.py +354 -0
- matplotlib_rs/_vendor/pyparsing/helpers.py +1770 -0
- matplotlib_rs/_vendor/pyparsing/results.py +929 -0
- matplotlib_rs/_vendor/pyparsing/testing.py +399 -0
- matplotlib_rs/_vendor/pyparsing/unicode.py +357 -0
- matplotlib_rs/_vendor/pyparsing/util.py +515 -0
- matplotlib_rs/_vendor/pyparsing/warnings.py +11 -0
- matplotlib_rs/_vendor/six.py +1004 -0
- matplotlib_rs/animation.py +1843 -0
- matplotlib_rs/artist.py +2302 -0
- matplotlib_rs/axes/__init__.py +19 -0
- matplotlib_rs/axes/_axes.py +9402 -0
- matplotlib_rs/axes/_bar.py +185 -0
- matplotlib_rs/axes/_base.py +5236 -0
- matplotlib_rs/axes/_base_rs.py +727 -0
- matplotlib_rs/axes/_boxplot.py +391 -0
- matplotlib_rs/axes/_hist.py +99 -0
- matplotlib_rs/axes/_secondary_axes.py +357 -0
- matplotlib_rs/axis.py +1963 -0
- matplotlib_rs/backend_bases.py +3760 -0
- matplotlib_rs/backend_managers.py +388 -0
- matplotlib_rs/backend_tools.py +1002 -0
- matplotlib_rs/backends/__init__.py +6 -0
- matplotlib_rs/backends/_backend_pdf_ps.py +451 -0
- matplotlib_rs/backends/backend_agg.py +552 -0
- matplotlib_rs/backends/backend_mixed.py +123 -0
- matplotlib_rs/backends/backend_pdf.py +2711 -0
- matplotlib_rs/backends/backend_pgf.py +1031 -0
- matplotlib_rs/backends/backend_ps.py +1491 -0
- matplotlib_rs/backends/backend_svg.py +1395 -0
- matplotlib_rs/backends/backend_template.py +214 -0
- matplotlib_rs/backends/registry.py +423 -0
- matplotlib_rs/bezier.py +691 -0
- matplotlib_rs/category.py +236 -0
- matplotlib_rs/cbook.py +2762 -0
- matplotlib_rs/cm.py +251 -0
- matplotlib_rs/collections.py +2711 -0
- matplotlib_rs/colorbar.py +1586 -0
- matplotlib_rs/colorizer.py +909 -0
- matplotlib_rs/colors.py +4278 -0
- matplotlib_rs/container.py +256 -0
- matplotlib_rs/contour.py +1756 -0
- matplotlib_rs/dates.py +1847 -0
- matplotlib_rs/dviread.py +1386 -0
- matplotlib_rs/figure.py +3815 -0
- matplotlib_rs/font_manager.py +1855 -0
- matplotlib_rs/ft2font.py +515 -0
- matplotlib_rs/gridspec.py +808 -0
- matplotlib_rs/hatch.py +244 -0
- matplotlib_rs/image.py +1863 -0
- matplotlib_rs/inset.py +291 -0
- matplotlib_rs/layout_engine.py +310 -0
- matplotlib_rs/legend.py +1480 -0
- matplotlib_rs/legend_handler.py +812 -0
- matplotlib_rs/lines.py +1886 -0
- matplotlib_rs/markers.py +908 -0
- matplotlib_rs/mathtext.py +141 -0
- matplotlib_rs/mlab.py +959 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-BoldOblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Oblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Bold.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-BoldOblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Oblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Bold.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-BoldItalic.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Italic.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/LICENSE_DEJAVU +99 -0
- matplotlib_rs/mpl-data/fonts/ttf/LICENSE_STIX +124 -0
- matplotlib_rs/mpl-data/fonts/ttf/LastResortHE-Regular.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneral.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralItalic.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUni.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniIta.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmb10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmex10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmmi10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmr10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmss10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmsy10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmti10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmtt10.ttf +0 -0
- matplotlib_rs/mpl-data/images/back-symbolic.svg +46 -0
- matplotlib_rs/mpl-data/images/back.pdf +0 -0
- matplotlib_rs/mpl-data/images/back.png +0 -0
- matplotlib_rs/mpl-data/images/back.svg +46 -0
- matplotlib_rs/mpl-data/images/back_large.png +0 -0
- matplotlib_rs/mpl-data/images/filesave-symbolic.svg +68 -0
- matplotlib_rs/mpl-data/images/filesave.pdf +72 -0
- matplotlib_rs/mpl-data/images/filesave.png +0 -0
- matplotlib_rs/mpl-data/images/filesave.svg +68 -0
- matplotlib_rs/mpl-data/images/filesave_large.png +0 -0
- matplotlib_rs/mpl-data/images/forward-symbolic.svg +46 -0
- matplotlib_rs/mpl-data/images/forward.pdf +0 -0
- matplotlib_rs/mpl-data/images/forward.png +0 -0
- matplotlib_rs/mpl-data/images/forward.svg +46 -0
- matplotlib_rs/mpl-data/images/forward_large.png +0 -0
- matplotlib_rs/mpl-data/images/hand.pdf +0 -0
- matplotlib_rs/mpl-data/images/hand.png +0 -0
- matplotlib_rs/mpl-data/images/hand.svg +130 -0
- matplotlib_rs/mpl-data/images/help-symbolic.svg +52 -0
- matplotlib_rs/mpl-data/images/help.pdf +71 -0
- matplotlib_rs/mpl-data/images/help.png +0 -0
- matplotlib_rs/mpl-data/images/help.svg +52 -0
- matplotlib_rs/mpl-data/images/help_large.png +0 -0
- matplotlib_rs/mpl-data/images/home-symbolic.svg +59 -0
- matplotlib_rs/mpl-data/images/home.pdf +0 -0
- matplotlib_rs/mpl-data/images/home.png +0 -0
- matplotlib_rs/mpl-data/images/home.svg +59 -0
- matplotlib_rs/mpl-data/images/home_large.png +0 -0
- matplotlib_rs/mpl-data/images/matplotlib.pdf +0 -0
- matplotlib_rs/mpl-data/images/matplotlib.png +0 -0
- matplotlib_rs/mpl-data/images/matplotlib.svg +3171 -0
- matplotlib_rs/mpl-data/images/matplotlib_large.png +0 -0
- matplotlib_rs/mpl-data/images/move-symbolic.svg +73 -0
- matplotlib_rs/mpl-data/images/move.pdf +0 -0
- matplotlib_rs/mpl-data/images/move.png +0 -0
- matplotlib_rs/mpl-data/images/move.svg +73 -0
- matplotlib_rs/mpl-data/images/move_large.png +0 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options.pdf +0 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options.png +0 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options.svg +48 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options_large.png +0 -0
- matplotlib_rs/mpl-data/images/subplots-symbolic.svg +81 -0
- matplotlib_rs/mpl-data/images/subplots.pdf +0 -0
- matplotlib_rs/mpl-data/images/subplots.png +0 -0
- matplotlib_rs/mpl-data/images/subplots.svg +81 -0
- matplotlib_rs/mpl-data/images/subplots_large.png +0 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect-symbolic.svg +40 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect.pdf +69 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect.png +0 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect.svg +40 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect_large.png +0 -0
- matplotlib_rs/mpl-data/kpsewhich.lua +4 -0
- matplotlib_rs/mpl-data/matplotlibrc +849 -0
- matplotlib_rs/mpl-data/plot_directive/plot_directive.css +16 -0
- matplotlib_rs/mpl-data/sample_data/Minduka_Present_Blue_Pack.png +0 -0
- matplotlib_rs/mpl-data/sample_data/README.txt +2 -0
- matplotlib_rs/mpl-data/sample_data/Stocks.csv +526 -0
- matplotlib_rs/mpl-data/sample_data/axes_grid/bivariate_normal.npy +0 -0
- matplotlib_rs/mpl-data/sample_data/data_x_x2_x3.csv +11 -0
- matplotlib_rs/mpl-data/sample_data/eeg.dat +0 -0
- matplotlib_rs/mpl-data/sample_data/embedding_in_wx3.xrc +65 -0
- matplotlib_rs/mpl-data/sample_data/goog.npz +0 -0
- matplotlib_rs/mpl-data/sample_data/grace_hopper.jpg +0 -0
- matplotlib_rs/mpl-data/sample_data/jacksboro_fault_dem.npz +0 -0
- matplotlib_rs/mpl-data/sample_data/logo2.png +0 -0
- matplotlib_rs/mpl-data/sample_data/membrane.dat +0 -0
- matplotlib_rs/mpl-data/sample_data/msft.csv +66 -0
- matplotlib_rs/mpl-data/sample_data/s1045.ima.gz +0 -0
- matplotlib_rs/mpl-data/sample_data/topobathy.npz +0 -0
- matplotlib_rs/mpl-data/stylelib/Solarize_Light2.mplstyle +53 -0
- matplotlib_rs/mpl-data/stylelib/_classic_test_patch.mplstyle +8 -0
- matplotlib_rs/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle +19 -0
- matplotlib_rs/mpl-data/stylelib/_mpl-gallery.mplstyle +19 -0
- matplotlib_rs/mpl-data/stylelib/bmh.mplstyle +27 -0
- matplotlib_rs/mpl-data/stylelib/classic.mplstyle +491 -0
- matplotlib_rs/mpl-data/stylelib/dark_background.mplstyle +26 -0
- matplotlib_rs/mpl-data/stylelib/fast.mplstyle +11 -0
- matplotlib_rs/mpl-data/stylelib/fivethirtyeight.mplstyle +37 -0
- matplotlib_rs/mpl-data/stylelib/ggplot.mplstyle +39 -0
- matplotlib_rs/mpl-data/stylelib/grayscale.mplstyle +29 -0
- matplotlib_rs/mpl-data/stylelib/petroff10.mplstyle +5 -0
- matplotlib_rs/mpl-data/stylelib/petroff6.mplstyle +5 -0
- matplotlib_rs/mpl-data/stylelib/petroff8.mplstyle +5 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-white.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8.mplstyle +57 -0
- matplotlib_rs/mpl-data/stylelib/tableau-colorblind10.mplstyle +3 -0
- matplotlib_rs/mpl_toolkits/__init__.py +3 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/__init__.py +11 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/anchored_artists.py +415 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_divider.py +619 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_grid.py +565 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_rgb.py +158 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_size.py +272 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/inset_locator.py +525 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/mpl_axes.py +129 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/parasite_axes.py +261 -0
- matplotlib_rs/mpl_toolkits/axisartist/__init__.py +15 -0
- matplotlib_rs/mpl_toolkits/axisartist/angle_helper.py +396 -0
- matplotlib_rs/mpl_toolkits/axisartist/axes_divider.py +3 -0
- matplotlib_rs/mpl_toolkits/axisartist/axis_artist.py +1148 -0
- matplotlib_rs/mpl_toolkits/axisartist/axisline_style.py +193 -0
- matplotlib_rs/mpl_toolkits/axisartist/axislines.py +475 -0
- matplotlib_rs/mpl_toolkits/axisartist/floating_axes.py +265 -0
- matplotlib_rs/mpl_toolkits/axisartist/grid_finder.py +329 -0
- matplotlib_rs/mpl_toolkits/axisartist/grid_helper_curvelinear.py +353 -0
- matplotlib_rs/mpl_toolkits/axisartist/parasite_axes.py +8 -0
- matplotlib_rs/mpl_toolkits/mplot3d/__init__.py +4 -0
- matplotlib_rs/mpl_toolkits/mplot3d/art3d.py +1758 -0
- matplotlib_rs/mpl_toolkits/mplot3d/axes3d.py +4462 -0
- matplotlib_rs/mpl_toolkits/mplot3d/axis3d.py +807 -0
- matplotlib_rs/mpl_toolkits/mplot3d/proj3d.py +270 -0
- matplotlib_rs/offsetbox.py +1726 -0
- matplotlib_rs/patches.py +5049 -0
- matplotlib_rs/path.py +1147 -0
- matplotlib_rs/patheffects.py +512 -0
- matplotlib_rs/projections/__init__.py +126 -0
- matplotlib_rs/projections/geo.py +512 -0
- matplotlib_rs/projections/polar.py +1518 -0
- matplotlib_rs/pylab.py +68 -0
- matplotlib_rs/pyplot.py +4834 -0
- matplotlib_rs/quiver.py +1236 -0
- matplotlib_rs/rcsetup.py +3435 -0
- matplotlib_rs/sankey.py +815 -0
- matplotlib_rs/scale.py +1002 -0
- matplotlib_rs/spines.py +618 -0
- matplotlib_rs/stackplot.py +144 -0
- matplotlib_rs/streamplot.py +768 -0
- matplotlib_rs/style/__init__.py +269 -0
- matplotlib_rs/style/core.py +28 -0
- matplotlib_rs/table.py +860 -0
- matplotlib_rs/texmanager.py +375 -0
- matplotlib_rs/text.py +2412 -0
- matplotlib_rs/textpath.py +377 -0
- matplotlib_rs/ticker.py +3111 -0
- matplotlib_rs/transforms.py +3069 -0
- matplotlib_rs/tri/__init__.py +24 -0
- matplotlib_rs/tri/_triangulation.py +248 -0
- matplotlib_rs/tri/_tricontour.py +271 -0
- matplotlib_rs/tri/_trifinder.py +97 -0
- matplotlib_rs/tri/_triinterpolate.py +1575 -0
- matplotlib_rs/tri/_tripcolor.py +170 -0
- matplotlib_rs/tri/_triplot.py +87 -0
- matplotlib_rs/tri/_trirefine.py +308 -0
- matplotlib_rs/tri/_tritools.py +264 -0
- matplotlib_rs/typing.py +597 -0
- matplotlib_rs/units.py +196 -0
- matplotlib_rs/widgets.py +4455 -0
- matplotlib_rs-0.0.8.dist-info/METADATA +392 -0
- matplotlib_rs-0.0.8.dist-info/RECORD +352 -0
- matplotlib_rs-0.0.8.dist-info/WHEEL +4 -0
- matplotlib_rs-0.0.8.dist-info/sboms/matplotlib-rs.cyclonedx.json +4390 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
Helper module for the *bbox_inches* parameter in `.Figure.savefig`.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from matplotlib_rs.transforms import Bbox, TransformedBbox, Affine2D
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def adjust_bbox(fig, bbox_inches, renderer, fixed_dpi=None):
|
|
10
|
+
"""
|
|
11
|
+
Temporarily adjust the figure so that only the specified area
|
|
12
|
+
(bbox_inches) is saved.
|
|
13
|
+
|
|
14
|
+
It modifies fig.bbox, fig.bbox_inches,
|
|
15
|
+
fig.transFigure._boxout, and fig.patch. While the figure size
|
|
16
|
+
changes, the scale of the original figure is conserved. A
|
|
17
|
+
function which restores the original values are returned.
|
|
18
|
+
"""
|
|
19
|
+
origBbox = fig.bbox
|
|
20
|
+
origBboxInches = fig.bbox_inches
|
|
21
|
+
_boxout = fig.transFigure._boxout
|
|
22
|
+
|
|
23
|
+
old_aspect = []
|
|
24
|
+
locator_list = []
|
|
25
|
+
sentinel = object()
|
|
26
|
+
for ax in fig.axes:
|
|
27
|
+
locator = ax.get_axes_locator()
|
|
28
|
+
if locator is not None:
|
|
29
|
+
ax.apply_aspect(locator(ax, renderer))
|
|
30
|
+
locator_list.append(locator)
|
|
31
|
+
current_pos = ax.get_position(original=False).frozen()
|
|
32
|
+
ax.set_axes_locator(lambda a, r, _pos=current_pos: _pos)
|
|
33
|
+
# override the method that enforces the aspect ratio on the Axes
|
|
34
|
+
if 'apply_aspect' in ax.__dict__:
|
|
35
|
+
old_aspect.append(ax.apply_aspect)
|
|
36
|
+
else:
|
|
37
|
+
old_aspect.append(sentinel)
|
|
38
|
+
ax.apply_aspect = lambda pos=None: None
|
|
39
|
+
|
|
40
|
+
def restore_bbox():
|
|
41
|
+
for ax, loc, aspect in zip(fig.axes, locator_list, old_aspect):
|
|
42
|
+
ax.set_axes_locator(loc)
|
|
43
|
+
if aspect is sentinel:
|
|
44
|
+
# delete our no-op function which un-hides the original method
|
|
45
|
+
del ax.apply_aspect
|
|
46
|
+
else:
|
|
47
|
+
ax.apply_aspect = aspect
|
|
48
|
+
|
|
49
|
+
fig.bbox = origBbox
|
|
50
|
+
fig.bbox_inches = origBboxInches
|
|
51
|
+
fig.transFigure._boxout = _boxout
|
|
52
|
+
fig.transFigure.invalidate()
|
|
53
|
+
fig.patch.set_bounds(0, 0, 1, 1)
|
|
54
|
+
|
|
55
|
+
if fixed_dpi is None:
|
|
56
|
+
fixed_dpi = fig.dpi
|
|
57
|
+
tr = Affine2D().scale(fixed_dpi)
|
|
58
|
+
dpi_scale = fixed_dpi / fig.dpi
|
|
59
|
+
|
|
60
|
+
fig.bbox_inches = Bbox.from_bounds(0, 0, *bbox_inches.size)
|
|
61
|
+
x0, y0 = tr.transform(bbox_inches.p0)
|
|
62
|
+
w1, h1 = fig.bbox.size * dpi_scale
|
|
63
|
+
fig.transFigure._boxout = Bbox.from_bounds(-x0, -y0, w1, h1)
|
|
64
|
+
fig.transFigure.invalidate()
|
|
65
|
+
|
|
66
|
+
fig.bbox = TransformedBbox(fig.bbox_inches, tr)
|
|
67
|
+
|
|
68
|
+
fig.patch.set_bounds(x0 / w1, y0 / h1,
|
|
69
|
+
fig.bbox.width / w1, fig.bbox.height / h1)
|
|
70
|
+
|
|
71
|
+
return restore_bbox
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def process_figure_for_rasterizing(fig, bbox_inches_restore, renderer, fixed_dpi=None):
|
|
75
|
+
"""
|
|
76
|
+
A function that needs to be called when figure dpi changes during the
|
|
77
|
+
drawing (e.g., rasterizing). It recovers the bbox and re-adjust it with
|
|
78
|
+
the new dpi.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
bbox_inches, restore_bbox = bbox_inches_restore
|
|
82
|
+
restore_bbox()
|
|
83
|
+
r = adjust_bbox(fig, bbox_inches, renderer, fixed_dpi)
|
|
84
|
+
|
|
85
|
+
return bbox_inches, r
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
Routines to adjust subplot params so that subplots are
|
|
4
|
+
nicely fit in the figure. In doing so, only axis labels, tick labels, Axes
|
|
5
|
+
titles and offsetboxes that are anchored to Axes are currently considered.
|
|
6
|
+
|
|
7
|
+
Internally, this module assumes that the margins (left margin, etc.) which are
|
|
8
|
+
differences between ``Axes.get_tightbbox`` and ``Axes.bbox`` are independent of
|
|
9
|
+
Axes position. This may fail if ``Axes.adjustable`` is ``datalim`` as well as
|
|
10
|
+
such cases as when left or right margin are affected by xlabel.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import numpy as np
|
|
14
|
+
|
|
15
|
+
import matplotlib_rs as mpl
|
|
16
|
+
from matplotlib_rs import _api, artist as martist
|
|
17
|
+
from matplotlib_rs.font_manager import FontProperties
|
|
18
|
+
from matplotlib_rs.transforms import Bbox
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _auto_adjust_subplotpars(
|
|
22
|
+
fig, renderer, shape, span_pairs, subplot_list,
|
|
23
|
+
ax_bbox_list=None, pad=1.08, h_pad=None, w_pad=None, rect=None):
|
|
24
|
+
"""
|
|
25
|
+
Return a dict of subplot parameters to adjust spacing between subplots
|
|
26
|
+
or ``None`` if resulting Axes would have zero height or width.
|
|
27
|
+
|
|
28
|
+
Note that this function ignores geometry information of subplot itself, but
|
|
29
|
+
uses what is given by the *shape* and *subplot_list* parameters. Also, the
|
|
30
|
+
results could be incorrect if some subplots have ``adjustable=datalim``.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
shape : tuple[int, int]
|
|
35
|
+
Number of rows and columns of the grid.
|
|
36
|
+
span_pairs : list[tuple[slice, slice]]
|
|
37
|
+
List of rowspans and colspans occupied by each subplot.
|
|
38
|
+
subplot_list : list of subplots
|
|
39
|
+
List of subplots that will be used to calculate optimal subplot_params.
|
|
40
|
+
pad : float
|
|
41
|
+
Padding between the figure edge and the edges of subplots, as a
|
|
42
|
+
fraction of the font size.
|
|
43
|
+
h_pad, w_pad : float
|
|
44
|
+
Padding (height/width) between edges of adjacent subplots, as a
|
|
45
|
+
fraction of the font size. Defaults to *pad*.
|
|
46
|
+
rect : tuple
|
|
47
|
+
(left, bottom, right, top), default: None.
|
|
48
|
+
"""
|
|
49
|
+
rows, cols = shape
|
|
50
|
+
|
|
51
|
+
font_size_inch = (FontProperties(
|
|
52
|
+
size=mpl.rcParams["font.size"]).get_size_in_points() / 72)
|
|
53
|
+
pad_inch = pad * font_size_inch
|
|
54
|
+
vpad_inch = h_pad * font_size_inch if h_pad is not None else pad_inch
|
|
55
|
+
hpad_inch = w_pad * font_size_inch if w_pad is not None else pad_inch
|
|
56
|
+
|
|
57
|
+
if len(span_pairs) != len(subplot_list) or len(subplot_list) == 0:
|
|
58
|
+
raise ValueError
|
|
59
|
+
|
|
60
|
+
if rect is None:
|
|
61
|
+
margin_left = margin_bottom = margin_right = margin_top = None
|
|
62
|
+
else:
|
|
63
|
+
margin_left, margin_bottom, _right, _top = rect
|
|
64
|
+
margin_right = 1 - _right if _right else None
|
|
65
|
+
margin_top = 1 - _top if _top else None
|
|
66
|
+
|
|
67
|
+
vspaces = np.zeros((rows + 1, cols))
|
|
68
|
+
hspaces = np.zeros((rows, cols + 1))
|
|
69
|
+
|
|
70
|
+
if ax_bbox_list is None:
|
|
71
|
+
ax_bbox_list = [
|
|
72
|
+
Bbox.union([ax.get_position(original=True) for ax in subplots])
|
|
73
|
+
for subplots in subplot_list]
|
|
74
|
+
|
|
75
|
+
for subplots, ax_bbox, (rowspan, colspan) in zip(
|
|
76
|
+
subplot_list, ax_bbox_list, span_pairs):
|
|
77
|
+
if all(not ax.get_visible() for ax in subplots):
|
|
78
|
+
continue
|
|
79
|
+
|
|
80
|
+
bb = []
|
|
81
|
+
for ax in subplots:
|
|
82
|
+
if ax.get_visible():
|
|
83
|
+
bb += [martist._get_tightbbox_for_layout_only(ax, renderer)]
|
|
84
|
+
|
|
85
|
+
tight_bbox_raw = Bbox.union(bb)
|
|
86
|
+
tight_bbox = fig.transFigure.inverted().transform_bbox(tight_bbox_raw)
|
|
87
|
+
|
|
88
|
+
hspaces[rowspan, colspan.start] += ax_bbox.xmin - tight_bbox.xmin # l
|
|
89
|
+
hspaces[rowspan, colspan.stop] += tight_bbox.xmax - ax_bbox.xmax # r
|
|
90
|
+
vspaces[rowspan.start, colspan] += tight_bbox.ymax - ax_bbox.ymax # t
|
|
91
|
+
vspaces[rowspan.stop, colspan] += ax_bbox.ymin - tight_bbox.ymin # b
|
|
92
|
+
|
|
93
|
+
fig_width_inch, fig_height_inch = fig.get_size_inches()
|
|
94
|
+
|
|
95
|
+
# margins can be negative for Axes with aspect applied, so use max(, 0) to
|
|
96
|
+
# make them nonnegative.
|
|
97
|
+
if not margin_left:
|
|
98
|
+
margin_left = max(hspaces[:, 0].max(), 0) + pad_inch/fig_width_inch
|
|
99
|
+
suplabel = fig._supylabel
|
|
100
|
+
if suplabel and suplabel.get_in_layout():
|
|
101
|
+
rel_width = fig.transFigure.inverted().transform_bbox(
|
|
102
|
+
suplabel.get_window_extent(renderer)).width
|
|
103
|
+
margin_left += rel_width + pad_inch/fig_width_inch
|
|
104
|
+
if not margin_right:
|
|
105
|
+
margin_right = max(hspaces[:, -1].max(), 0) + pad_inch/fig_width_inch
|
|
106
|
+
if not margin_top:
|
|
107
|
+
margin_top = max(vspaces[0, :].max(), 0) + pad_inch/fig_height_inch
|
|
108
|
+
if fig._suptitle and fig._suptitle.get_in_layout():
|
|
109
|
+
rel_height = fig.transFigure.inverted().transform_bbox(
|
|
110
|
+
fig._suptitle.get_window_extent(renderer)).height
|
|
111
|
+
margin_top += rel_height + pad_inch/fig_height_inch
|
|
112
|
+
if not margin_bottom:
|
|
113
|
+
margin_bottom = max(vspaces[-1, :].max(), 0) + pad_inch/fig_height_inch
|
|
114
|
+
suplabel = fig._supxlabel
|
|
115
|
+
if suplabel and suplabel.get_in_layout():
|
|
116
|
+
rel_height = fig.transFigure.inverted().transform_bbox(
|
|
117
|
+
suplabel.get_window_extent(renderer)).height
|
|
118
|
+
margin_bottom += rel_height + pad_inch/fig_height_inch
|
|
119
|
+
|
|
120
|
+
if margin_left + margin_right >= 1:
|
|
121
|
+
_api.warn_external('Tight layout not applied. The left and right '
|
|
122
|
+
'margins cannot be made large enough to '
|
|
123
|
+
'accommodate all Axes decorations.')
|
|
124
|
+
return None
|
|
125
|
+
if margin_bottom + margin_top >= 1:
|
|
126
|
+
_api.warn_external('Tight layout not applied. The bottom and top '
|
|
127
|
+
'margins cannot be made large enough to '
|
|
128
|
+
'accommodate all Axes decorations.')
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
kwargs = dict(left=margin_left,
|
|
132
|
+
right=1 - margin_right,
|
|
133
|
+
bottom=margin_bottom,
|
|
134
|
+
top=1 - margin_top)
|
|
135
|
+
|
|
136
|
+
if cols > 1:
|
|
137
|
+
hspace = hspaces[:, 1:-1].max() + hpad_inch / fig_width_inch
|
|
138
|
+
# axes widths:
|
|
139
|
+
h_axes = (1 - margin_right - margin_left - hspace * (cols - 1)) / cols
|
|
140
|
+
if h_axes < 0:
|
|
141
|
+
_api.warn_external('Tight layout not applied. tight_layout '
|
|
142
|
+
'cannot make Axes width small enough to '
|
|
143
|
+
'accommodate all Axes decorations')
|
|
144
|
+
return None
|
|
145
|
+
else:
|
|
146
|
+
kwargs["wspace"] = hspace / h_axes
|
|
147
|
+
if rows > 1:
|
|
148
|
+
vspace = vspaces[1:-1, :].max() + vpad_inch / fig_height_inch
|
|
149
|
+
v_axes = (1 - margin_top - margin_bottom - vspace * (rows - 1)) / rows
|
|
150
|
+
if v_axes < 0:
|
|
151
|
+
_api.warn_external('Tight layout not applied. tight_layout '
|
|
152
|
+
'cannot make Axes height small enough to '
|
|
153
|
+
'accommodate all Axes decorations.')
|
|
154
|
+
return None
|
|
155
|
+
else:
|
|
156
|
+
kwargs["hspace"] = vspace / v_axes
|
|
157
|
+
|
|
158
|
+
return kwargs
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def get_subplotspec_list(axes_list, grid_spec=None):
|
|
162
|
+
"""
|
|
163
|
+
Return a list of subplotspec from the given list of Axes.
|
|
164
|
+
|
|
165
|
+
For an instance of Axes that does not support subplotspec, None is inserted
|
|
166
|
+
in the list.
|
|
167
|
+
|
|
168
|
+
If grid_spec is given, None is inserted for those not from the given
|
|
169
|
+
grid_spec.
|
|
170
|
+
"""
|
|
171
|
+
subplotspec_list = []
|
|
172
|
+
for ax in axes_list:
|
|
173
|
+
axes_or_locator = ax.get_axes_locator()
|
|
174
|
+
if axes_or_locator is None:
|
|
175
|
+
axes_or_locator = ax
|
|
176
|
+
|
|
177
|
+
if hasattr(axes_or_locator, "get_subplotspec"):
|
|
178
|
+
subplotspec = axes_or_locator.get_subplotspec()
|
|
179
|
+
if subplotspec is not None:
|
|
180
|
+
subplotspec = subplotspec.get_topmost_subplotspec()
|
|
181
|
+
gs = subplotspec.get_gridspec()
|
|
182
|
+
if grid_spec is not None:
|
|
183
|
+
if gs != grid_spec:
|
|
184
|
+
subplotspec = None
|
|
185
|
+
elif gs.locally_modified_subplot_params():
|
|
186
|
+
subplotspec = None
|
|
187
|
+
else:
|
|
188
|
+
subplotspec = None
|
|
189
|
+
|
|
190
|
+
subplotspec_list.append(subplotspec)
|
|
191
|
+
|
|
192
|
+
return subplotspec_list
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
|
|
196
|
+
pad=1.08, h_pad=None, w_pad=None, rect=None):
|
|
197
|
+
"""
|
|
198
|
+
Return subplot parameters for tight-layouted-figure with specified padding.
|
|
199
|
+
|
|
200
|
+
Parameters
|
|
201
|
+
----------
|
|
202
|
+
fig : Figure
|
|
203
|
+
axes_list : list of Axes
|
|
204
|
+
subplotspec_list : list of `.SubplotSpec`
|
|
205
|
+
The subplotspecs of each Axes.
|
|
206
|
+
renderer : renderer
|
|
207
|
+
pad : float
|
|
208
|
+
Padding between the figure edge and the edges of subplots, as a
|
|
209
|
+
fraction of the font size.
|
|
210
|
+
h_pad, w_pad : float
|
|
211
|
+
Padding (height/width) between edges of adjacent subplots. Defaults to
|
|
212
|
+
*pad*.
|
|
213
|
+
rect : tuple (left, bottom, right, top), default: None.
|
|
214
|
+
rectangle in normalized figure coordinates
|
|
215
|
+
that the whole subplots area (including labels) will fit into.
|
|
216
|
+
Defaults to using the entire figure.
|
|
217
|
+
|
|
218
|
+
Returns
|
|
219
|
+
-------
|
|
220
|
+
subplotspec or None
|
|
221
|
+
subplotspec kwargs to be passed to `.Figure.subplots_adjust` or
|
|
222
|
+
None if tight_layout could not be accomplished.
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
# Multiple Axes can share same subplotspec (e.g., if using axes_grid1);
|
|
226
|
+
# we need to group them together.
|
|
227
|
+
ss_to_subplots = {ss: [] for ss in subplotspec_list}
|
|
228
|
+
for ax, ss in zip(axes_list, subplotspec_list):
|
|
229
|
+
ss_to_subplots[ss].append(ax)
|
|
230
|
+
if ss_to_subplots.pop(None, None):
|
|
231
|
+
_api.warn_external(
|
|
232
|
+
"This figure includes Axes that are not compatible with "
|
|
233
|
+
"tight_layout, so results might be incorrect.")
|
|
234
|
+
if not ss_to_subplots:
|
|
235
|
+
return {}
|
|
236
|
+
subplot_list = list(ss_to_subplots.values())
|
|
237
|
+
ax_bbox_list = [ss.get_position(fig) for ss in ss_to_subplots]
|
|
238
|
+
|
|
239
|
+
max_nrows = max(ss.get_gridspec().nrows for ss in ss_to_subplots)
|
|
240
|
+
max_ncols = max(ss.get_gridspec().ncols for ss in ss_to_subplots)
|
|
241
|
+
|
|
242
|
+
span_pairs = []
|
|
243
|
+
for ss in ss_to_subplots:
|
|
244
|
+
# The intent here is to support Axes from different gridspecs where
|
|
245
|
+
# one's nrows (or ncols) is a multiple of the other (e.g. 2 and 4),
|
|
246
|
+
# but this doesn't actually work because the computed wspace, in
|
|
247
|
+
# relative-axes-height, corresponds to different physical spacings for
|
|
248
|
+
# the 2-row grid and the 4-row grid. Still, this code is left, mostly
|
|
249
|
+
# for backcompat.
|
|
250
|
+
rows, cols = ss.get_gridspec().get_geometry()
|
|
251
|
+
div_row, mod_row = divmod(max_nrows, rows)
|
|
252
|
+
div_col, mod_col = divmod(max_ncols, cols)
|
|
253
|
+
if mod_row != 0:
|
|
254
|
+
_api.warn_external('tight_layout not applied: number of rows '
|
|
255
|
+
'in subplot specifications must be '
|
|
256
|
+
'multiples of one another.')
|
|
257
|
+
return {}
|
|
258
|
+
if mod_col != 0:
|
|
259
|
+
_api.warn_external('tight_layout not applied: number of '
|
|
260
|
+
'columns in subplot specifications must be '
|
|
261
|
+
'multiples of one another.')
|
|
262
|
+
return {}
|
|
263
|
+
span_pairs.append((
|
|
264
|
+
slice(ss.rowspan.start * div_row, ss.rowspan.stop * div_row),
|
|
265
|
+
slice(ss.colspan.start * div_col, ss.colspan.stop * div_col)))
|
|
266
|
+
|
|
267
|
+
kwargs = _auto_adjust_subplotpars(fig, renderer,
|
|
268
|
+
shape=(max_nrows, max_ncols),
|
|
269
|
+
span_pairs=span_pairs,
|
|
270
|
+
subplot_list=subplot_list,
|
|
271
|
+
ax_bbox_list=ax_bbox_list,
|
|
272
|
+
pad=pad, h_pad=h_pad, w_pad=w_pad)
|
|
273
|
+
|
|
274
|
+
# kwargs can be none if tight_layout fails...
|
|
275
|
+
if rect is not None and kwargs is not None:
|
|
276
|
+
# if rect is given, the whole subplots area (including
|
|
277
|
+
# labels) will fit into the rect instead of the
|
|
278
|
+
# figure. Note that the rect argument of
|
|
279
|
+
# *auto_adjust_subplotpars* specify the area that will be
|
|
280
|
+
# covered by the total area of axes.bbox. Thus we call
|
|
281
|
+
# auto_adjust_subplotpars twice, where the second run
|
|
282
|
+
# with adjusted rect parameters.
|
|
283
|
+
|
|
284
|
+
left, bottom, right, top = rect
|
|
285
|
+
if left is not None:
|
|
286
|
+
left += kwargs["left"]
|
|
287
|
+
if bottom is not None:
|
|
288
|
+
bottom += kwargs["bottom"]
|
|
289
|
+
if right is not None:
|
|
290
|
+
right -= (1 - kwargs["right"])
|
|
291
|
+
if top is not None:
|
|
292
|
+
top -= (1 - kwargs["top"])
|
|
293
|
+
|
|
294
|
+
kwargs = _auto_adjust_subplotpars(fig, renderer,
|
|
295
|
+
shape=(max_nrows, max_ncols),
|
|
296
|
+
span_pairs=span_pairs,
|
|
297
|
+
subplot_list=subplot_list,
|
|
298
|
+
ax_bbox_list=ax_bbox_list,
|
|
299
|
+
pad=pad, h_pad=h_pad, w_pad=w_pad,
|
|
300
|
+
rect=(left, bottom, right, top))
|
|
301
|
+
|
|
302
|
+
return kwargs
|
matplotlib_rs/_tri.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Replacement for matplotlib's ``_tri`` extension module, backed by the Rust
|
|
3
|
+
port of ``src/tri/_tri.cpp``.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
from . import _mplrs
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _coords(a):
|
|
12
|
+
return np.ascontiguousarray(a, dtype=np.float64)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _ints(a):
|
|
16
|
+
return np.ascontiguousarray(a, dtype=np.int32)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Triangulation:
|
|
20
|
+
"""
|
|
21
|
+
Create a new C++ Triangulation object.
|
|
22
|
+
This should not be called directly, use the python class
|
|
23
|
+
matplotlib.tri.Triangulation instead.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __init__(self, x, y, triangles, mask, edges, neighbors,
|
|
27
|
+
correct_triangle_orientations):
|
|
28
|
+
x, y = _coords(x), _coords(y)
|
|
29
|
+
triangles = _ints(triangles)
|
|
30
|
+
mask = np.ascontiguousarray(mask, dtype=bool)
|
|
31
|
+
edges, neighbors = _ints(edges), _ints(neighbors)
|
|
32
|
+
if x.ndim != 1 or y.ndim != 1 or x.shape[0] != y.shape[0]:
|
|
33
|
+
raise ValueError("x and y must be 1D arrays of the same length")
|
|
34
|
+
if triangles.ndim != 2 or triangles.shape[1] != 3:
|
|
35
|
+
raise ValueError("triangles must be a 2D array of shape (?,3)")
|
|
36
|
+
if mask.size > 0 and (mask.ndim != 1 or mask.shape[0] != triangles.shape[0]):
|
|
37
|
+
raise ValueError(
|
|
38
|
+
"mask must be a 1D array with the same length as the triangles array")
|
|
39
|
+
if edges.size > 0 and (edges.ndim != 2 or edges.shape[1] != 2):
|
|
40
|
+
raise ValueError("edges must be a 2D array with shape (?,2)")
|
|
41
|
+
if neighbors.size > 0 and (neighbors.ndim != 2
|
|
42
|
+
or neighbors.shape != triangles.shape):
|
|
43
|
+
raise ValueError(
|
|
44
|
+
"neighbors must be a 2D array with the same shape as the triangles array")
|
|
45
|
+
if correct_triangle_orientations:
|
|
46
|
+
# in place, like the C++ code (which shares int32 C arrays)
|
|
47
|
+
_mplrs.tri_correct_triangles(
|
|
48
|
+
x, y, triangles, neighbors if neighbors.size > 0 else None)
|
|
49
|
+
self._x = x
|
|
50
|
+
self._ntri = triangles.shape[0]
|
|
51
|
+
self._rs = _mplrs.Triangulation(
|
|
52
|
+
x, y, triangles, mask.reshape(-1),
|
|
53
|
+
edges.reshape(-1, 2), neighbors.reshape(-1, 3))
|
|
54
|
+
self._edges = edges if edges.size > 0 else None
|
|
55
|
+
self._neighbors = neighbors if neighbors.size > 0 else None
|
|
56
|
+
|
|
57
|
+
def calculate_plane_coefficients(self, z):
|
|
58
|
+
"""Calculate plane equation coefficients for all unmasked triangles."""
|
|
59
|
+
z = _coords(z)
|
|
60
|
+
if z.ndim != 1 or z.shape[0] != self._x.shape[0]:
|
|
61
|
+
raise ValueError(
|
|
62
|
+
"z must be a 1D array with the same length as the triangulation "
|
|
63
|
+
"x and y arrays")
|
|
64
|
+
return self._rs.calculate_plane_coefficients(z)
|
|
65
|
+
|
|
66
|
+
def get_edges(self):
|
|
67
|
+
"""Return edges array."""
|
|
68
|
+
if self._edges is None:
|
|
69
|
+
self._edges = self._rs.get_edges()
|
|
70
|
+
return self._edges
|
|
71
|
+
|
|
72
|
+
def get_neighbors(self):
|
|
73
|
+
"""Return neighbors array."""
|
|
74
|
+
if self._neighbors is None:
|
|
75
|
+
self._neighbors = self._rs.get_neighbors()
|
|
76
|
+
return self._neighbors
|
|
77
|
+
|
|
78
|
+
def set_mask(self, mask):
|
|
79
|
+
"""Set or clear the mask array."""
|
|
80
|
+
mask = np.ascontiguousarray(mask, dtype=bool)
|
|
81
|
+
if mask.size > 0 and (mask.ndim != 1 or mask.shape[0] != self._ntri):
|
|
82
|
+
raise ValueError(
|
|
83
|
+
"mask must be a 1D array with the same length as the triangles array")
|
|
84
|
+
self._rs.set_mask(mask.reshape(-1))
|
|
85
|
+
self._edges = None
|
|
86
|
+
self._neighbors = None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class TriContourGenerator:
|
|
91
|
+
"""
|
|
92
|
+
Create a new C++ TriContourGenerator object.
|
|
93
|
+
This should not be called directly, use the functions
|
|
94
|
+
matplotlib.axes.tricontour and tricontourf instead.
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
def __init__(self, triangulation, z):
|
|
98
|
+
z = _coords(z)
|
|
99
|
+
if z.ndim != 1:
|
|
100
|
+
raise ValueError(
|
|
101
|
+
"z must be a 1D array with the same length as the x and y arrays")
|
|
102
|
+
self._rs = _mplrs.TriContourGenerator(triangulation._rs, z)
|
|
103
|
+
|
|
104
|
+
def create_contour(self, level):
|
|
105
|
+
"""Create and return a non-filled contour."""
|
|
106
|
+
return self._rs.create_contour(float(level))
|
|
107
|
+
|
|
108
|
+
def create_filled_contour(self, lower_level, upper_level):
|
|
109
|
+
"""Create and return a filled contour."""
|
|
110
|
+
return self._rs.create_filled_contour(float(lower_level), float(upper_level))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class TrapezoidMapTriFinder:
|
|
114
|
+
"""
|
|
115
|
+
Create a new C++ TrapezoidMapTriFinder object.
|
|
116
|
+
This should not be called directly, use the python class
|
|
117
|
+
matplotlib.tri.TrapezoidMapTriFinder instead.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
def __init__(self, triangulation):
|
|
121
|
+
self._rs = _mplrs.TrapezoidMapTriFinder(triangulation._rs)
|
|
122
|
+
|
|
123
|
+
def find_many(self, x, y):
|
|
124
|
+
"""Find indices of triangles containing the point coordinates (x, y)."""
|
|
125
|
+
x, y = _coords(x), _coords(y)
|
|
126
|
+
if x.ndim != 1 or y.ndim != 1 or x.shape[0] != y.shape[0]:
|
|
127
|
+
raise ValueError("x and y must be array-like with same shape")
|
|
128
|
+
return self._rs.find_many(x, y)
|
|
129
|
+
|
|
130
|
+
def get_tree_stats(self):
|
|
131
|
+
"""Return statistics about the tree used by the trapezoid map."""
|
|
132
|
+
return list(self._rs.get_tree_stats())
|
|
133
|
+
|
|
134
|
+
def initialize(self):
|
|
135
|
+
"""Initialize this object, creating the trapezoid map from the triangulation."""
|
|
136
|
+
self._rs.initialize()
|
|
137
|
+
|
|
138
|
+
def print_tree(self):
|
|
139
|
+
"""Print the search tree as text to stdout; useful for debug purposes."""
|
|
140
|
+
self._rs.print_tree()
|