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,619 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
Helper classes to adjust the positions of multiple axes at drawing time.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import functools
|
|
7
|
+
|
|
8
|
+
import numpy as np
|
|
9
|
+
|
|
10
|
+
import matplotlib_rs as mpl
|
|
11
|
+
from matplotlib_rs import _api
|
|
12
|
+
from matplotlib_rs.gridspec import SubplotSpec
|
|
13
|
+
import matplotlib_rs.transforms as mtransforms
|
|
14
|
+
from . import axes_size as Size
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Divider:
|
|
18
|
+
"""
|
|
19
|
+
An Axes positioning class.
|
|
20
|
+
|
|
21
|
+
The divider is initialized with lists of horizontal and vertical sizes
|
|
22
|
+
(:mod:`mpl_toolkits.axes_grid1.axes_size`) based on which a given
|
|
23
|
+
rectangular area will be divided.
|
|
24
|
+
|
|
25
|
+
The `new_locator` method then creates a callable object
|
|
26
|
+
that can be used as the *axes_locator* of the axes.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(self, fig, pos, horizontal, vertical,
|
|
30
|
+
aspect=None, anchor="C"):
|
|
31
|
+
"""
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
fig : Figure
|
|
35
|
+
pos : tuple of 4 floats
|
|
36
|
+
Position of the rectangle that will be divided.
|
|
37
|
+
horizontal : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
|
|
38
|
+
Sizes for horizontal division.
|
|
39
|
+
vertical : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
|
|
40
|
+
Sizes for vertical division.
|
|
41
|
+
aspect : bool, optional
|
|
42
|
+
Whether overall rectangular area is reduced so that the relative
|
|
43
|
+
part of the horizontal and vertical scales have the same scale.
|
|
44
|
+
anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', \
|
|
45
|
+
'NW', 'W'}, default: 'C'
|
|
46
|
+
Placement of the reduced rectangle, when *aspect* is True.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
self._fig = fig
|
|
50
|
+
self._pos = pos
|
|
51
|
+
self._horizontal = horizontal
|
|
52
|
+
self._vertical = vertical
|
|
53
|
+
self._anchor = anchor
|
|
54
|
+
self.set_anchor(anchor)
|
|
55
|
+
self._aspect = aspect
|
|
56
|
+
self._xrefindex = 0
|
|
57
|
+
self._yrefindex = 0
|
|
58
|
+
self._locator = None
|
|
59
|
+
|
|
60
|
+
def get_horizontal_sizes(self, renderer):
|
|
61
|
+
return np.array([s.get_size(renderer) for s in self.get_horizontal()])
|
|
62
|
+
|
|
63
|
+
def get_vertical_sizes(self, renderer):
|
|
64
|
+
return np.array([s.get_size(renderer) for s in self.get_vertical()])
|
|
65
|
+
|
|
66
|
+
def set_position(self, pos):
|
|
67
|
+
"""
|
|
68
|
+
Set the position of the rectangle.
|
|
69
|
+
|
|
70
|
+
Parameters
|
|
71
|
+
----------
|
|
72
|
+
pos : tuple of 4 floats
|
|
73
|
+
position of the rectangle that will be divided
|
|
74
|
+
"""
|
|
75
|
+
self._pos = pos
|
|
76
|
+
|
|
77
|
+
def get_position(self):
|
|
78
|
+
"""Return the position of the rectangle."""
|
|
79
|
+
return self._pos
|
|
80
|
+
|
|
81
|
+
def set_anchor(self, anchor):
|
|
82
|
+
"""
|
|
83
|
+
Parameters
|
|
84
|
+
----------
|
|
85
|
+
anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', \
|
|
86
|
+
'NW', 'W'}
|
|
87
|
+
Either an (*x*, *y*) pair of relative coordinates (0 is left or
|
|
88
|
+
bottom, 1 is right or top), 'C' (center), or a cardinal direction
|
|
89
|
+
('SW', southwest, is bottom left, etc.).
|
|
90
|
+
|
|
91
|
+
See Also
|
|
92
|
+
--------
|
|
93
|
+
.Axes.set_anchor
|
|
94
|
+
"""
|
|
95
|
+
if isinstance(anchor, str):
|
|
96
|
+
_api.check_in_list(mtransforms.Bbox.coefs, anchor=anchor)
|
|
97
|
+
elif not isinstance(anchor, (tuple, list)) or len(anchor) != 2:
|
|
98
|
+
raise TypeError("anchor must be str or 2-tuple")
|
|
99
|
+
self._anchor = anchor
|
|
100
|
+
|
|
101
|
+
def get_anchor(self):
|
|
102
|
+
"""Return the anchor."""
|
|
103
|
+
return self._anchor
|
|
104
|
+
|
|
105
|
+
def get_subplotspec(self):
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
def set_horizontal(self, h):
|
|
109
|
+
"""
|
|
110
|
+
Parameters
|
|
111
|
+
----------
|
|
112
|
+
h : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
|
|
113
|
+
sizes for horizontal division
|
|
114
|
+
"""
|
|
115
|
+
self._horizontal = h
|
|
116
|
+
|
|
117
|
+
def get_horizontal(self):
|
|
118
|
+
"""Return horizontal sizes."""
|
|
119
|
+
return self._horizontal
|
|
120
|
+
|
|
121
|
+
def set_vertical(self, v):
|
|
122
|
+
"""
|
|
123
|
+
Parameters
|
|
124
|
+
----------
|
|
125
|
+
v : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
|
|
126
|
+
sizes for vertical division
|
|
127
|
+
"""
|
|
128
|
+
self._vertical = v
|
|
129
|
+
|
|
130
|
+
def get_vertical(self):
|
|
131
|
+
"""Return vertical sizes."""
|
|
132
|
+
return self._vertical
|
|
133
|
+
|
|
134
|
+
def set_aspect(self, aspect=False):
|
|
135
|
+
"""
|
|
136
|
+
Parameters
|
|
137
|
+
----------
|
|
138
|
+
aspect : bool
|
|
139
|
+
"""
|
|
140
|
+
self._aspect = aspect
|
|
141
|
+
|
|
142
|
+
def get_aspect(self):
|
|
143
|
+
"""Return aspect."""
|
|
144
|
+
return self._aspect
|
|
145
|
+
|
|
146
|
+
def set_locator(self, _locator):
|
|
147
|
+
self._locator = _locator
|
|
148
|
+
|
|
149
|
+
def get_locator(self):
|
|
150
|
+
return self._locator
|
|
151
|
+
|
|
152
|
+
def get_position_runtime(self, ax, renderer):
|
|
153
|
+
if self._locator is None:
|
|
154
|
+
return self.get_position()
|
|
155
|
+
else:
|
|
156
|
+
return self._locator(ax, renderer).bounds
|
|
157
|
+
|
|
158
|
+
@staticmethod
|
|
159
|
+
def _calc_k(sizes, total):
|
|
160
|
+
# sizes is a (n, 2) array of (rel_size, abs_size); this method finds
|
|
161
|
+
# the k factor such that sum(rel_size * k + abs_size) == total.
|
|
162
|
+
rel_sum, abs_sum = sizes.sum(0)
|
|
163
|
+
return (total - abs_sum) / rel_sum if rel_sum else 0
|
|
164
|
+
|
|
165
|
+
@staticmethod
|
|
166
|
+
def _calc_offsets(sizes, k):
|
|
167
|
+
# Apply k factors to (n, 2) sizes array of (rel_size, abs_size); return
|
|
168
|
+
# the resulting cumulative offset positions.
|
|
169
|
+
return np.cumsum([0, *(sizes @ [k, 1])])
|
|
170
|
+
|
|
171
|
+
def new_locator(self, nx, ny, nx1=None, ny1=None):
|
|
172
|
+
"""
|
|
173
|
+
Return an axes locator callable for the specified cell.
|
|
174
|
+
|
|
175
|
+
Parameters
|
|
176
|
+
----------
|
|
177
|
+
nx, nx1 : int
|
|
178
|
+
Integers specifying the column-position of the
|
|
179
|
+
cell. When *nx1* is None, a single *nx*-th column is
|
|
180
|
+
specified. Otherwise, location of columns spanning between *nx*
|
|
181
|
+
to *nx1* (but excluding *nx1*-th column) is specified.
|
|
182
|
+
ny, ny1 : int
|
|
183
|
+
Same as *nx* and *nx1*, but for row positions.
|
|
184
|
+
"""
|
|
185
|
+
if nx1 is None:
|
|
186
|
+
nx1 = nx + 1
|
|
187
|
+
if ny1 is None:
|
|
188
|
+
ny1 = ny + 1
|
|
189
|
+
# append_size("left") adds a new size at the beginning of the
|
|
190
|
+
# horizontal size lists; this shift transforms e.g.
|
|
191
|
+
# new_locator(nx=2, ...) into effectively new_locator(nx=3, ...). To
|
|
192
|
+
# take that into account, instead of recording nx, we record
|
|
193
|
+
# nx-self._xrefindex, where _xrefindex is shifted by 1 by each
|
|
194
|
+
# append_size("left"), and re-add self._xrefindex back to nx in
|
|
195
|
+
# _locate, when the actual axes position is computed. Ditto for y.
|
|
196
|
+
xref = self._xrefindex
|
|
197
|
+
yref = self._yrefindex
|
|
198
|
+
locator = functools.partial(
|
|
199
|
+
self._locate, nx - xref, ny - yref, nx1 - xref, ny1 - yref)
|
|
200
|
+
locator.get_subplotspec = self.get_subplotspec
|
|
201
|
+
return locator
|
|
202
|
+
|
|
203
|
+
def _locate(self, nx, ny, nx1, ny1, axes, renderer):
|
|
204
|
+
"""
|
|
205
|
+
Implementation of ``divider.new_locator().__call__``.
|
|
206
|
+
|
|
207
|
+
The axes locator callable returned by ``new_locator()`` is created as
|
|
208
|
+
a `functools.partial` of this method with *nx*, *ny*, *nx1*, and *ny1*
|
|
209
|
+
specifying the requested cell.
|
|
210
|
+
"""
|
|
211
|
+
nx += self._xrefindex
|
|
212
|
+
nx1 += self._xrefindex
|
|
213
|
+
ny += self._yrefindex
|
|
214
|
+
ny1 += self._yrefindex
|
|
215
|
+
|
|
216
|
+
fig_w, fig_h = self._fig.bbox.size / self._fig.dpi
|
|
217
|
+
x, y, w, h = self.get_position_runtime(axes, renderer)
|
|
218
|
+
|
|
219
|
+
hsizes = self.get_horizontal_sizes(renderer)
|
|
220
|
+
vsizes = self.get_vertical_sizes(renderer)
|
|
221
|
+
k_h = self._calc_k(hsizes, fig_w * w)
|
|
222
|
+
k_v = self._calc_k(vsizes, fig_h * h)
|
|
223
|
+
|
|
224
|
+
if self.get_aspect():
|
|
225
|
+
k = min(k_h, k_v)
|
|
226
|
+
ox = self._calc_offsets(hsizes, k)
|
|
227
|
+
oy = self._calc_offsets(vsizes, k)
|
|
228
|
+
|
|
229
|
+
ww = (ox[-1] - ox[0]) / fig_w
|
|
230
|
+
hh = (oy[-1] - oy[0]) / fig_h
|
|
231
|
+
pb = mtransforms.Bbox.from_bounds(x, y, w, h)
|
|
232
|
+
pb1 = mtransforms.Bbox.from_bounds(x, y, ww, hh)
|
|
233
|
+
x0, y0 = pb1.anchored(self.get_anchor(), pb).p0
|
|
234
|
+
|
|
235
|
+
else:
|
|
236
|
+
ox = self._calc_offsets(hsizes, k_h)
|
|
237
|
+
oy = self._calc_offsets(vsizes, k_v)
|
|
238
|
+
x0, y0 = x, y
|
|
239
|
+
|
|
240
|
+
if nx1 is None:
|
|
241
|
+
nx1 = -1
|
|
242
|
+
if ny1 is None:
|
|
243
|
+
ny1 = -1
|
|
244
|
+
|
|
245
|
+
x1, w1 = x0 + ox[nx] / fig_w, (ox[nx1] - ox[nx]) / fig_w
|
|
246
|
+
y1, h1 = y0 + oy[ny] / fig_h, (oy[ny1] - oy[ny]) / fig_h
|
|
247
|
+
|
|
248
|
+
return mtransforms.Bbox.from_bounds(x1, y1, w1, h1)
|
|
249
|
+
|
|
250
|
+
def append_size(self, position, size):
|
|
251
|
+
_api.check_in_list(["left", "right", "bottom", "top"],
|
|
252
|
+
position=position)
|
|
253
|
+
if position == "left":
|
|
254
|
+
self._horizontal.insert(0, size)
|
|
255
|
+
self._xrefindex += 1
|
|
256
|
+
elif position == "right":
|
|
257
|
+
self._horizontal.append(size)
|
|
258
|
+
elif position == "bottom":
|
|
259
|
+
self._vertical.insert(0, size)
|
|
260
|
+
self._yrefindex += 1
|
|
261
|
+
else: # 'top'
|
|
262
|
+
self._vertical.append(size)
|
|
263
|
+
|
|
264
|
+
def add_auto_adjustable_area(self, use_axes, pad=0.1, adjust_dirs=None):
|
|
265
|
+
"""
|
|
266
|
+
Add auto-adjustable padding around *use_axes* to take their decorations
|
|
267
|
+
(title, labels, ticks, ticklabels) into account during layout.
|
|
268
|
+
|
|
269
|
+
Parameters
|
|
270
|
+
----------
|
|
271
|
+
use_axes : `~matplotlib.axes.Axes` or list of `~matplotlib.axes.Axes`
|
|
272
|
+
The Axes whose decorations are taken into account.
|
|
273
|
+
pad : float, default: 0.1
|
|
274
|
+
Additional padding in inches.
|
|
275
|
+
adjust_dirs : list of {"left", "right", "bottom", "top"}, optional
|
|
276
|
+
The sides where padding is added; defaults to all four sides.
|
|
277
|
+
"""
|
|
278
|
+
if adjust_dirs is None:
|
|
279
|
+
adjust_dirs = ["left", "right", "bottom", "top"]
|
|
280
|
+
for d in adjust_dirs:
|
|
281
|
+
self.append_size(d, Size._AxesDecorationsSize(use_axes, d) + pad)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class SubplotDivider(Divider):
|
|
285
|
+
"""
|
|
286
|
+
The Divider class whose rectangle area is specified as a subplot geometry.
|
|
287
|
+
"""
|
|
288
|
+
|
|
289
|
+
def __init__(self, fig, *args, horizontal=None, vertical=None,
|
|
290
|
+
aspect=None, anchor='C'):
|
|
291
|
+
"""
|
|
292
|
+
Parameters
|
|
293
|
+
----------
|
|
294
|
+
fig : `~matplotlib.figure.Figure`
|
|
295
|
+
|
|
296
|
+
*args : tuple (*nrows*, *ncols*, *index*) or int
|
|
297
|
+
The array of subplots in the figure has dimensions ``(nrows,
|
|
298
|
+
ncols)``, and *index* is the index of the subplot being created.
|
|
299
|
+
*index* starts at 1 in the upper left corner and increases to the
|
|
300
|
+
right.
|
|
301
|
+
|
|
302
|
+
If *nrows*, *ncols*, and *index* are all single digit numbers, then
|
|
303
|
+
*args* can be passed as a single 3-digit number (e.g. 234 for
|
|
304
|
+
(2, 3, 4)).
|
|
305
|
+
horizontal : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`, optional
|
|
306
|
+
Sizes for horizontal division.
|
|
307
|
+
vertical : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`, optional
|
|
308
|
+
Sizes for vertical division.
|
|
309
|
+
aspect : bool, optional
|
|
310
|
+
Whether overall rectangular area is reduced so that the relative
|
|
311
|
+
part of the horizontal and vertical scales have the same scale.
|
|
312
|
+
anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', \
|
|
313
|
+
'NW', 'W'}, default: 'C'
|
|
314
|
+
Placement of the reduced rectangle, when *aspect* is True.
|
|
315
|
+
"""
|
|
316
|
+
self.figure = fig
|
|
317
|
+
super().__init__(fig, [0, 0, 1, 1],
|
|
318
|
+
horizontal=horizontal or [], vertical=vertical or [],
|
|
319
|
+
aspect=aspect, anchor=anchor)
|
|
320
|
+
self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args))
|
|
321
|
+
|
|
322
|
+
def get_position(self):
|
|
323
|
+
"""Return the bounds of the subplot box."""
|
|
324
|
+
return self.get_subplotspec().get_position(self.figure).bounds
|
|
325
|
+
|
|
326
|
+
def get_subplotspec(self):
|
|
327
|
+
"""Get the SubplotSpec instance."""
|
|
328
|
+
return self._subplotspec
|
|
329
|
+
|
|
330
|
+
def set_subplotspec(self, subplotspec):
|
|
331
|
+
"""Set the SubplotSpec instance."""
|
|
332
|
+
self._subplotspec = subplotspec
|
|
333
|
+
self.set_position(subplotspec.get_position(self.figure))
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
class AxesDivider(Divider):
|
|
337
|
+
"""
|
|
338
|
+
Divider based on the preexisting axes.
|
|
339
|
+
"""
|
|
340
|
+
|
|
341
|
+
def __init__(self, axes, xref=None, yref=None):
|
|
342
|
+
"""
|
|
343
|
+
Parameters
|
|
344
|
+
----------
|
|
345
|
+
axes : :class:`~matplotlib.axes.Axes`
|
|
346
|
+
xref
|
|
347
|
+
yref
|
|
348
|
+
"""
|
|
349
|
+
self._axes = axes
|
|
350
|
+
if xref is None:
|
|
351
|
+
self._xref = Size.AxesX(axes)
|
|
352
|
+
else:
|
|
353
|
+
self._xref = xref
|
|
354
|
+
if yref is None:
|
|
355
|
+
self._yref = Size.AxesY(axes)
|
|
356
|
+
else:
|
|
357
|
+
self._yref = yref
|
|
358
|
+
|
|
359
|
+
super().__init__(fig=axes.get_figure(), pos=None,
|
|
360
|
+
horizontal=[self._xref], vertical=[self._yref],
|
|
361
|
+
aspect=None, anchor="C")
|
|
362
|
+
|
|
363
|
+
def _get_new_axes(self, *, axes_class=None, **kwargs):
|
|
364
|
+
axes = self._axes
|
|
365
|
+
if axes_class is None:
|
|
366
|
+
axes_class = type(axes)
|
|
367
|
+
return axes_class(axes.get_figure(), axes.get_position(original=True),
|
|
368
|
+
**kwargs)
|
|
369
|
+
|
|
370
|
+
def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
|
|
371
|
+
"""
|
|
372
|
+
Helper method for ``append_axes("left")`` and ``append_axes("right")``.
|
|
373
|
+
|
|
374
|
+
See the documentation of `append_axes` for more details.
|
|
375
|
+
|
|
376
|
+
:meta private:
|
|
377
|
+
"""
|
|
378
|
+
if pad is None:
|
|
379
|
+
pad = mpl.rcParams["figure.subplot.wspace"] * self._xref
|
|
380
|
+
pos = "left" if pack_start else "right"
|
|
381
|
+
if pad:
|
|
382
|
+
if not isinstance(pad, Size._Base):
|
|
383
|
+
pad = Size.from_any(pad, fraction_ref=self._xref)
|
|
384
|
+
self.append_size(pos, pad)
|
|
385
|
+
if not isinstance(size, Size._Base):
|
|
386
|
+
size = Size.from_any(size, fraction_ref=self._xref)
|
|
387
|
+
self.append_size(pos, size)
|
|
388
|
+
locator = self.new_locator(
|
|
389
|
+
nx=0 if pack_start else len(self._horizontal) - 1,
|
|
390
|
+
ny=self._yrefindex)
|
|
391
|
+
ax = self._get_new_axes(**kwargs)
|
|
392
|
+
ax.set_axes_locator(locator)
|
|
393
|
+
return ax
|
|
394
|
+
|
|
395
|
+
def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
|
|
396
|
+
"""
|
|
397
|
+
Helper method for ``append_axes("top")`` and ``append_axes("bottom")``.
|
|
398
|
+
|
|
399
|
+
See the documentation of `append_axes` for more details.
|
|
400
|
+
|
|
401
|
+
:meta private:
|
|
402
|
+
"""
|
|
403
|
+
if pad is None:
|
|
404
|
+
pad = mpl.rcParams["figure.subplot.hspace"] * self._yref
|
|
405
|
+
pos = "bottom" if pack_start else "top"
|
|
406
|
+
if pad:
|
|
407
|
+
if not isinstance(pad, Size._Base):
|
|
408
|
+
pad = Size.from_any(pad, fraction_ref=self._yref)
|
|
409
|
+
self.append_size(pos, pad)
|
|
410
|
+
if not isinstance(size, Size._Base):
|
|
411
|
+
size = Size.from_any(size, fraction_ref=self._yref)
|
|
412
|
+
self.append_size(pos, size)
|
|
413
|
+
locator = self.new_locator(
|
|
414
|
+
nx=self._xrefindex,
|
|
415
|
+
ny=0 if pack_start else len(self._vertical) - 1)
|
|
416
|
+
ax = self._get_new_axes(**kwargs)
|
|
417
|
+
ax.set_axes_locator(locator)
|
|
418
|
+
return ax
|
|
419
|
+
|
|
420
|
+
def append_axes(self, position, size, pad=None, *, axes_class=None,
|
|
421
|
+
**kwargs):
|
|
422
|
+
"""
|
|
423
|
+
Add a new axes on a given side of the main axes.
|
|
424
|
+
|
|
425
|
+
Parameters
|
|
426
|
+
----------
|
|
427
|
+
position : {"left", "right", "bottom", "top"}
|
|
428
|
+
Where the new axes is positioned relative to the main axes.
|
|
429
|
+
size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
|
|
430
|
+
The axes width or height. float or str arguments are interpreted
|
|
431
|
+
as ``axes_size.from_any(size, AxesX(<main_axes>))`` for left or
|
|
432
|
+
right axes, and likewise with ``AxesY`` for bottom or top axes.
|
|
433
|
+
pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
|
|
434
|
+
Padding between the axes. float or str arguments are interpreted
|
|
435
|
+
as for *size*. Defaults to :rc:`figure.subplot.wspace` times the
|
|
436
|
+
main Axes width (left or right axes) or :rc:`figure.subplot.hspace`
|
|
437
|
+
times the main Axes height (bottom or top axes).
|
|
438
|
+
axes_class : subclass type of `~.axes.Axes`, optional
|
|
439
|
+
The type of the new axes. Defaults to the type of the main axes.
|
|
440
|
+
**kwargs
|
|
441
|
+
All extra keywords arguments are passed to the created axes.
|
|
442
|
+
"""
|
|
443
|
+
create_axes, pack_start = _api.getitem_checked({
|
|
444
|
+
"left": (self.new_horizontal, True),
|
|
445
|
+
"right": (self.new_horizontal, False),
|
|
446
|
+
"bottom": (self.new_vertical, True),
|
|
447
|
+
"top": (self.new_vertical, False),
|
|
448
|
+
}, position=position)
|
|
449
|
+
ax = create_axes(
|
|
450
|
+
size, pad, pack_start=pack_start, axes_class=axes_class, **kwargs)
|
|
451
|
+
self._fig.add_axes(ax)
|
|
452
|
+
return ax
|
|
453
|
+
|
|
454
|
+
def get_aspect(self):
|
|
455
|
+
if self._aspect is None:
|
|
456
|
+
aspect = self._axes.get_aspect()
|
|
457
|
+
if aspect == "auto":
|
|
458
|
+
return False
|
|
459
|
+
else:
|
|
460
|
+
return True
|
|
461
|
+
else:
|
|
462
|
+
return self._aspect
|
|
463
|
+
|
|
464
|
+
def get_position(self):
|
|
465
|
+
if self._pos is None:
|
|
466
|
+
bbox = self._axes.get_position(original=True)
|
|
467
|
+
return bbox.bounds
|
|
468
|
+
else:
|
|
469
|
+
return self._pos
|
|
470
|
+
|
|
471
|
+
def get_anchor(self):
|
|
472
|
+
if self._anchor is None:
|
|
473
|
+
return self._axes.get_anchor()
|
|
474
|
+
else:
|
|
475
|
+
return self._anchor
|
|
476
|
+
|
|
477
|
+
def get_subplotspec(self):
|
|
478
|
+
return self._axes.get_subplotspec()
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
# Helper for HBoxDivider/VBoxDivider.
|
|
482
|
+
# The variable names are written for a horizontal layout, but the calculations
|
|
483
|
+
# work identically for vertical layouts.
|
|
484
|
+
def _locate(x, y, w, h, summed_widths, equal_heights, fig_w, fig_h, anchor):
|
|
485
|
+
|
|
486
|
+
total_width = fig_w * w
|
|
487
|
+
max_height = fig_h * h
|
|
488
|
+
|
|
489
|
+
# Determine the k factors.
|
|
490
|
+
n = len(equal_heights)
|
|
491
|
+
eq_rels, eq_abss = equal_heights.T
|
|
492
|
+
sm_rels, sm_abss = summed_widths.T
|
|
493
|
+
A = np.diag([*eq_rels, 0])
|
|
494
|
+
A[:n, -1] = -1
|
|
495
|
+
A[-1, :-1] = sm_rels
|
|
496
|
+
B = [*(-eq_abss), total_width - sm_abss.sum()]
|
|
497
|
+
# A @ K = B: This finds factors {k_0, ..., k_{N-1}, H} so that
|
|
498
|
+
# eq_rel_i * k_i + eq_abs_i = H for all i: all axes have the same height
|
|
499
|
+
# sum(sm_rel_i * k_i + sm_abs_i) = total_width: fixed total width
|
|
500
|
+
# (foo_rel_i * k_i + foo_abs_i will end up being the size of foo.)
|
|
501
|
+
*karray, height = np.linalg.solve(A, B)
|
|
502
|
+
if height > max_height: # Additionally, upper-bound the height.
|
|
503
|
+
karray = (max_height - eq_abss) / eq_rels
|
|
504
|
+
|
|
505
|
+
# Compute the offsets corresponding to these factors.
|
|
506
|
+
ox = np.cumsum([0, *(sm_rels * karray + sm_abss)])
|
|
507
|
+
ww = (ox[-1] - ox[0]) / fig_w
|
|
508
|
+
h0_rel, h0_abs = equal_heights[0]
|
|
509
|
+
hh = (karray[0]*h0_rel + h0_abs) / fig_h
|
|
510
|
+
pb = mtransforms.Bbox.from_bounds(x, y, w, h)
|
|
511
|
+
pb1 = mtransforms.Bbox.from_bounds(x, y, ww, hh)
|
|
512
|
+
x0, y0 = pb1.anchored(anchor, pb).p0
|
|
513
|
+
|
|
514
|
+
return x0, y0, ox, hh
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
class HBoxDivider(SubplotDivider):
|
|
518
|
+
"""
|
|
519
|
+
A `.SubplotDivider` for laying out axes horizontally, while ensuring that
|
|
520
|
+
they have equal heights.
|
|
521
|
+
|
|
522
|
+
Examples
|
|
523
|
+
--------
|
|
524
|
+
.. plot:: gallery/axes_grid1/demo_axes_hbox_divider.py
|
|
525
|
+
"""
|
|
526
|
+
|
|
527
|
+
def new_locator(self, nx, nx1=None):
|
|
528
|
+
"""
|
|
529
|
+
Create an axes locator callable for the specified cell.
|
|
530
|
+
|
|
531
|
+
Parameters
|
|
532
|
+
----------
|
|
533
|
+
nx, nx1 : int
|
|
534
|
+
Integers specifying the column-position of the
|
|
535
|
+
cell. When *nx1* is None, a single *nx*-th column is
|
|
536
|
+
specified. Otherwise, location of columns spanning between *nx*
|
|
537
|
+
to *nx1* (but excluding *nx1*-th column) is specified.
|
|
538
|
+
"""
|
|
539
|
+
return super().new_locator(nx, 0, nx1, 0)
|
|
540
|
+
|
|
541
|
+
def _locate(self, nx, ny, nx1, ny1, axes, renderer):
|
|
542
|
+
# docstring inherited
|
|
543
|
+
nx += self._xrefindex
|
|
544
|
+
nx1 += self._xrefindex
|
|
545
|
+
fig_w, fig_h = self._fig.bbox.size / self._fig.dpi
|
|
546
|
+
x, y, w, h = self.get_position_runtime(axes, renderer)
|
|
547
|
+
summed_ws = self.get_horizontal_sizes(renderer)
|
|
548
|
+
equal_hs = self.get_vertical_sizes(renderer)
|
|
549
|
+
x0, y0, ox, hh = _locate(
|
|
550
|
+
x, y, w, h, summed_ws, equal_hs, fig_w, fig_h, self.get_anchor())
|
|
551
|
+
if nx1 is None:
|
|
552
|
+
nx1 = -1
|
|
553
|
+
x1, w1 = x0 + ox[nx] / fig_w, (ox[nx1] - ox[nx]) / fig_w
|
|
554
|
+
y1, h1 = y0, hh
|
|
555
|
+
return mtransforms.Bbox.from_bounds(x1, y1, w1, h1)
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
class VBoxDivider(SubplotDivider):
|
|
559
|
+
"""
|
|
560
|
+
A `.SubplotDivider` for laying out axes vertically, while ensuring that
|
|
561
|
+
they have equal widths.
|
|
562
|
+
"""
|
|
563
|
+
|
|
564
|
+
def new_locator(self, ny, ny1=None):
|
|
565
|
+
"""
|
|
566
|
+
Create an axes locator callable for the specified cell.
|
|
567
|
+
|
|
568
|
+
Parameters
|
|
569
|
+
----------
|
|
570
|
+
ny, ny1 : int
|
|
571
|
+
Integers specifying the row-position of the
|
|
572
|
+
cell. When *ny1* is None, a single *ny*-th row is
|
|
573
|
+
specified. Otherwise, location of rows spanning between *ny*
|
|
574
|
+
to *ny1* (but excluding *ny1*-th row) is specified.
|
|
575
|
+
"""
|
|
576
|
+
return super().new_locator(0, ny, 0, ny1)
|
|
577
|
+
|
|
578
|
+
def _locate(self, nx, ny, nx1, ny1, axes, renderer):
|
|
579
|
+
# docstring inherited
|
|
580
|
+
ny += self._yrefindex
|
|
581
|
+
ny1 += self._yrefindex
|
|
582
|
+
fig_w, fig_h = self._fig.bbox.size / self._fig.dpi
|
|
583
|
+
x, y, w, h = self.get_position_runtime(axes, renderer)
|
|
584
|
+
summed_hs = self.get_vertical_sizes(renderer)
|
|
585
|
+
equal_ws = self.get_horizontal_sizes(renderer)
|
|
586
|
+
y0, x0, oy, ww = _locate(
|
|
587
|
+
y, x, h, w, summed_hs, equal_ws, fig_h, fig_w, self.get_anchor())
|
|
588
|
+
if ny1 is None:
|
|
589
|
+
ny1 = -1
|
|
590
|
+
x1, w1 = x0, ww
|
|
591
|
+
y1, h1 = y0 + oy[ny] / fig_h, (oy[ny1] - oy[ny]) / fig_h
|
|
592
|
+
return mtransforms.Bbox.from_bounds(x1, y1, w1, h1)
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
def make_axes_locatable(axes):
|
|
596
|
+
divider = AxesDivider(axes)
|
|
597
|
+
locator = divider.new_locator(nx=0, ny=0)
|
|
598
|
+
axes.set_axes_locator(locator)
|
|
599
|
+
|
|
600
|
+
return divider
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
def make_axes_area_auto_adjustable(
|
|
604
|
+
ax, use_axes=None, pad=0.1, adjust_dirs=None):
|
|
605
|
+
"""
|
|
606
|
+
Add auto-adjustable padding around *ax* to take its decorations (title,
|
|
607
|
+
labels, ticks, ticklabels) into account during layout, using
|
|
608
|
+
`.Divider.add_auto_adjustable_area`.
|
|
609
|
+
|
|
610
|
+
By default, padding is determined from the decorations of *ax*.
|
|
611
|
+
Pass *use_axes* to consider the decorations of other Axes instead.
|
|
612
|
+
"""
|
|
613
|
+
if adjust_dirs is None:
|
|
614
|
+
adjust_dirs = ["left", "right", "bottom", "top"]
|
|
615
|
+
divider = make_axes_locatable(ax)
|
|
616
|
+
if use_axes is None:
|
|
617
|
+
use_axes = ax
|
|
618
|
+
divider.add_auto_adjustable_area(use_axes=use_axes, pad=pad,
|
|
619
|
+
adjust_dirs=adjust_dirs)
|