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
matplotlib_rs/inset.py
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
The inset module defines the InsetIndicator class, which draws the rectangle and
|
|
4
|
+
connectors required for `.Axes.indicate_inset` and `.Axes.indicate_inset_zoom`.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from . import _api, artist, transforms
|
|
8
|
+
from matplotlib_rs.patches import ConnectionPatch, PathPatch, Rectangle
|
|
9
|
+
from matplotlib_rs.path import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
_shared_properties = ('alpha', 'edgecolor', 'linestyle', 'linewidth')
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class InsetIndicator(artist.Artist):
|
|
16
|
+
"""
|
|
17
|
+
An artist to highlight an area of interest.
|
|
18
|
+
|
|
19
|
+
An inset indicator is a rectangle on the plot at the position indicated by
|
|
20
|
+
*bounds* that optionally has lines that connect the rectangle to an inset
|
|
21
|
+
Axes (`.Axes.inset_axes`).
|
|
22
|
+
|
|
23
|
+
.. versionadded:: 3.10
|
|
24
|
+
"""
|
|
25
|
+
zorder = 4.99
|
|
26
|
+
|
|
27
|
+
def __init__(self, bounds=None, inset_ax=None, zorder=None, **kwargs):
|
|
28
|
+
"""
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
bounds : [x0, y0, width, height], optional
|
|
32
|
+
Lower-left corner of rectangle to be marked, and its width
|
|
33
|
+
and height. If not set, the bounds will be calculated from the
|
|
34
|
+
data limits of inset_ax, which must be supplied.
|
|
35
|
+
|
|
36
|
+
inset_ax : `~.axes.Axes`, optional
|
|
37
|
+
An optional inset Axes to draw connecting lines to. Two lines are
|
|
38
|
+
drawn connecting the indicator box to the inset Axes on corners
|
|
39
|
+
chosen so as to not overlap with the indicator box.
|
|
40
|
+
|
|
41
|
+
zorder : float, default: 4.99
|
|
42
|
+
Drawing order of the rectangle and connector lines. The default,
|
|
43
|
+
4.99, is just below the default level of inset Axes.
|
|
44
|
+
|
|
45
|
+
**kwargs
|
|
46
|
+
Other keyword arguments are passed on to the `.Rectangle` patch.
|
|
47
|
+
"""
|
|
48
|
+
if bounds is None and inset_ax is None:
|
|
49
|
+
raise ValueError("At least one of bounds or inset_ax must be supplied")
|
|
50
|
+
|
|
51
|
+
self._inset_ax = inset_ax
|
|
52
|
+
|
|
53
|
+
if bounds is None:
|
|
54
|
+
# Work out bounds from inset_ax
|
|
55
|
+
self._auto_update_bounds = True
|
|
56
|
+
bounds = self._bounds_from_inset_ax()
|
|
57
|
+
else:
|
|
58
|
+
self._auto_update_bounds = False
|
|
59
|
+
|
|
60
|
+
x, y, width, height = bounds
|
|
61
|
+
|
|
62
|
+
self._rectangle = Rectangle((x, y), width, height, clip_on=False, **kwargs)
|
|
63
|
+
|
|
64
|
+
# Connector positions cannot be calculated till the artist has been added
|
|
65
|
+
# to an axes, so just make an empty list for now.
|
|
66
|
+
self._connectors = []
|
|
67
|
+
|
|
68
|
+
super().__init__()
|
|
69
|
+
self.set_zorder(zorder)
|
|
70
|
+
|
|
71
|
+
# Initial style properties for the artist should match the rectangle.
|
|
72
|
+
for prop in _shared_properties:
|
|
73
|
+
setattr(self, f'_{prop}', artist.getp(self._rectangle, prop))
|
|
74
|
+
|
|
75
|
+
def _shared_setter(self, prop, val):
|
|
76
|
+
"""
|
|
77
|
+
Helper function to set the same style property on the artist and its children.
|
|
78
|
+
"""
|
|
79
|
+
setattr(self, f'_{prop}', val)
|
|
80
|
+
|
|
81
|
+
artist.setp([self._rectangle, *self._connectors], prop, val)
|
|
82
|
+
|
|
83
|
+
@artist.Artist.axes.setter
|
|
84
|
+
def axes(self, new_axes):
|
|
85
|
+
# Set axes on the rectangle (required for some external transforms to work) as
|
|
86
|
+
# well as the InsetIndicator artist.
|
|
87
|
+
self.rectangle.axes = new_axes
|
|
88
|
+
artist.Artist.axes.fset(self, new_axes)
|
|
89
|
+
|
|
90
|
+
def set_alpha(self, alpha):
|
|
91
|
+
# docstring inherited
|
|
92
|
+
self._shared_setter('alpha', alpha)
|
|
93
|
+
|
|
94
|
+
def set_edgecolor(self, color):
|
|
95
|
+
"""
|
|
96
|
+
Set the edge color of the rectangle and the connectors.
|
|
97
|
+
|
|
98
|
+
Parameters
|
|
99
|
+
----------
|
|
100
|
+
color : :mpltype:`color` or None
|
|
101
|
+
"""
|
|
102
|
+
self._shared_setter('edgecolor', color)
|
|
103
|
+
|
|
104
|
+
def set_color(self, c):
|
|
105
|
+
"""
|
|
106
|
+
Set the edgecolor of the rectangle and the connectors, and the
|
|
107
|
+
facecolor for the rectangle.
|
|
108
|
+
|
|
109
|
+
Parameters
|
|
110
|
+
----------
|
|
111
|
+
c : :mpltype:`color`
|
|
112
|
+
"""
|
|
113
|
+
self._shared_setter('edgecolor', c)
|
|
114
|
+
self._shared_setter('facecolor', c)
|
|
115
|
+
|
|
116
|
+
def set_linewidth(self, w):
|
|
117
|
+
"""
|
|
118
|
+
Set the linewidth in points of the rectangle and the connectors.
|
|
119
|
+
|
|
120
|
+
Parameters
|
|
121
|
+
----------
|
|
122
|
+
w : float or None
|
|
123
|
+
"""
|
|
124
|
+
self._shared_setter('linewidth', w)
|
|
125
|
+
|
|
126
|
+
def set_linestyle(self, ls):
|
|
127
|
+
"""
|
|
128
|
+
Set the linestyle of the rectangle and the connectors.
|
|
129
|
+
|
|
130
|
+
Parameters
|
|
131
|
+
----------
|
|
132
|
+
ls : {'-', '--', '-.', ':', '', ...} or (offset, on-off-seq)
|
|
133
|
+
Possible values:
|
|
134
|
+
|
|
135
|
+
- A string:
|
|
136
|
+
|
|
137
|
+
======================================================= ================
|
|
138
|
+
linestyle description
|
|
139
|
+
======================================================= ================
|
|
140
|
+
``'-'`` or ``'solid'`` solid line
|
|
141
|
+
``'--'`` or ``'dashed'`` dashed line
|
|
142
|
+
``'-.'`` or ``'dashdot'`` dash-dotted line
|
|
143
|
+
``':'`` or ``'dotted'`` dotted line
|
|
144
|
+
``''`` or ``'none'`` (discouraged: ``'None'``, ``' '``) draw nothing
|
|
145
|
+
======================================================= ================
|
|
146
|
+
|
|
147
|
+
- A tuple describing the start position and lengths of dashes and spaces:
|
|
148
|
+
|
|
149
|
+
(offset, onoffseq)
|
|
150
|
+
|
|
151
|
+
where
|
|
152
|
+
|
|
153
|
+
- *offset* is a float specifying the offset (in points); i.e. how much
|
|
154
|
+
is the dash pattern shifted.
|
|
155
|
+
- *onoffseq* is a sequence of on and off ink in points. There can be
|
|
156
|
+
arbitrary many pairs of on and off values.
|
|
157
|
+
|
|
158
|
+
Example: The tuple ``(0, (10, 5, 1, 5))`` means that the pattern starts
|
|
159
|
+
at the beginning of the line. It draws a 10 point long dash,
|
|
160
|
+
then a 5 point long space, then a 1 point long dash, followed by a 5 point
|
|
161
|
+
long space, and then the pattern repeats.
|
|
162
|
+
|
|
163
|
+
For examples see :doc:`/gallery/lines_bars_and_markers/linestyles`.
|
|
164
|
+
"""
|
|
165
|
+
self._shared_setter('linestyle', ls)
|
|
166
|
+
|
|
167
|
+
def _bounds_from_inset_ax(self):
|
|
168
|
+
xlim = self._inset_ax.get_xlim()
|
|
169
|
+
ylim = self._inset_ax.get_ylim()
|
|
170
|
+
return (xlim[0], ylim[0], xlim[1] - xlim[0], ylim[1] - ylim[0])
|
|
171
|
+
|
|
172
|
+
def _update_connectors(self):
|
|
173
|
+
(x, y) = self._rectangle.get_xy()
|
|
174
|
+
width = self._rectangle.get_width()
|
|
175
|
+
height = self._rectangle.get_height()
|
|
176
|
+
|
|
177
|
+
existing_connectors = self._connectors or [None] * 4
|
|
178
|
+
|
|
179
|
+
# connect the inset_axes to the rectangle
|
|
180
|
+
for xy_inset_ax, existing in zip([(0, 0), (0, 1), (1, 0), (1, 1)],
|
|
181
|
+
existing_connectors):
|
|
182
|
+
# inset_ax positions are in axes coordinates
|
|
183
|
+
# The 0, 1 values define the four edges if the inset_ax
|
|
184
|
+
# lower_left, upper_left, lower_right upper_right.
|
|
185
|
+
ex, ey = xy_inset_ax
|
|
186
|
+
if self.axes.xaxis.get_inverted():
|
|
187
|
+
ex = 1 - ex
|
|
188
|
+
if self.axes.yaxis.get_inverted():
|
|
189
|
+
ey = 1 - ey
|
|
190
|
+
xy_data = x + ex * width, y + ey * height
|
|
191
|
+
if existing is None:
|
|
192
|
+
# Create new connection patch with styles inherited from the
|
|
193
|
+
# parent artist.
|
|
194
|
+
p = ConnectionPatch(
|
|
195
|
+
xyA=xy_inset_ax, coordsA=self._inset_ax.transAxes,
|
|
196
|
+
xyB=xy_data, coordsB=self.rectangle.get_data_transform(),
|
|
197
|
+
arrowstyle="-",
|
|
198
|
+
edgecolor=self._edgecolor, alpha=self.get_alpha(),
|
|
199
|
+
linestyle=self._linestyle, linewidth=self._linewidth)
|
|
200
|
+
self._connectors.append(p)
|
|
201
|
+
else:
|
|
202
|
+
# Only update positioning of existing connection patch. We
|
|
203
|
+
# do not want to override any style settings made by the user.
|
|
204
|
+
existing.xy1 = xy_inset_ax
|
|
205
|
+
existing.xy2 = xy_data
|
|
206
|
+
existing.coords1 = self._inset_ax.transAxes
|
|
207
|
+
existing.coords2 = self.rectangle.get_data_transform()
|
|
208
|
+
|
|
209
|
+
if existing is None:
|
|
210
|
+
# decide which two of the lines to keep visible....
|
|
211
|
+
pos = self._inset_ax.get_position()
|
|
212
|
+
bboxins = pos.transformed(self.get_figure(root=False).transSubfigure)
|
|
213
|
+
rectbbox = transforms.Bbox.from_bounds(x, y, width, height).transformed(
|
|
214
|
+
self._rectangle.get_transform())
|
|
215
|
+
x0 = rectbbox.x0 < bboxins.x0
|
|
216
|
+
x1 = rectbbox.x1 < bboxins.x1
|
|
217
|
+
y0 = rectbbox.y0 < bboxins.y0
|
|
218
|
+
y1 = rectbbox.y1 < bboxins.y1
|
|
219
|
+
self._connectors[0].set_visible(x0 ^ y0)
|
|
220
|
+
self._connectors[1].set_visible(x0 == y1)
|
|
221
|
+
self._connectors[2].set_visible(x1 == y0)
|
|
222
|
+
self._connectors[3].set_visible(x1 ^ y1)
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def rectangle(self):
|
|
226
|
+
"""`.Rectangle`: the indicator frame."""
|
|
227
|
+
return self._rectangle
|
|
228
|
+
|
|
229
|
+
@property
|
|
230
|
+
def connectors(self):
|
|
231
|
+
"""
|
|
232
|
+
4-tuple of `.patches.ConnectionPatch` or None
|
|
233
|
+
The four connector lines connecting to (lower_left, upper_left,
|
|
234
|
+
lower_right upper_right) corners of *inset_ax*. Two lines are
|
|
235
|
+
set with visibility to *False*, but the user can set the
|
|
236
|
+
visibility to True if the automatic choice is not deemed correct.
|
|
237
|
+
"""
|
|
238
|
+
if self._inset_ax is None:
|
|
239
|
+
return
|
|
240
|
+
|
|
241
|
+
if self._auto_update_bounds:
|
|
242
|
+
self._rectangle.set_bounds(self._bounds_from_inset_ax())
|
|
243
|
+
self._update_connectors()
|
|
244
|
+
return tuple(self._connectors)
|
|
245
|
+
|
|
246
|
+
def draw(self, renderer):
|
|
247
|
+
# docstring inherited
|
|
248
|
+
conn_same_style = []
|
|
249
|
+
|
|
250
|
+
# Figure out which connectors have the same style as the box, so should
|
|
251
|
+
# be drawn as a single path.
|
|
252
|
+
for conn in self.connectors or []:
|
|
253
|
+
if conn.get_visible():
|
|
254
|
+
drawn = False
|
|
255
|
+
for s in _shared_properties:
|
|
256
|
+
if artist.getp(self._rectangle, s) != artist.getp(conn, s):
|
|
257
|
+
# Draw this connector by itself
|
|
258
|
+
conn.draw(renderer)
|
|
259
|
+
drawn = True
|
|
260
|
+
break
|
|
261
|
+
|
|
262
|
+
if not drawn:
|
|
263
|
+
# Connector has same style as box.
|
|
264
|
+
conn_same_style.append(conn)
|
|
265
|
+
|
|
266
|
+
if conn_same_style:
|
|
267
|
+
# Since at least one connector has the same style as the rectangle, draw
|
|
268
|
+
# them as a compound path.
|
|
269
|
+
artists = [self._rectangle] + conn_same_style
|
|
270
|
+
paths = [a.get_transform().transform_path(a.get_path()) for a in artists]
|
|
271
|
+
path = Path.make_compound_path(*paths)
|
|
272
|
+
|
|
273
|
+
# Create a temporary patch to draw the path.
|
|
274
|
+
p = PathPatch(path)
|
|
275
|
+
p.update_from(self._rectangle)
|
|
276
|
+
p.set_transform(transforms.IdentityTransform())
|
|
277
|
+
p.draw(renderer)
|
|
278
|
+
|
|
279
|
+
return
|
|
280
|
+
|
|
281
|
+
# Just draw the rectangle
|
|
282
|
+
self._rectangle.draw(renderer)
|
|
283
|
+
|
|
284
|
+
@_api.deprecated(
|
|
285
|
+
'3.10',
|
|
286
|
+
message=('Since Matplotlib 3.10 indicate_inset_[zoom] returns a single '
|
|
287
|
+
'InsetIndicator artist with a rectangle property and a connectors '
|
|
288
|
+
'property. From 3.12 it will no longer be possible to unpack the '
|
|
289
|
+
'return value into two elements.'))
|
|
290
|
+
def __getitem__(self, key):
|
|
291
|
+
return [self._rectangle, self.connectors][key]
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
Classes to layout elements in a `.Figure`.
|
|
4
|
+
|
|
5
|
+
Figures have a ``layout_engine`` property that holds a subclass of
|
|
6
|
+
`~.LayoutEngine` defined here (or *None* for no layout). At draw time
|
|
7
|
+
``figure.get_layout_engine().execute()`` is called, the goal of which is
|
|
8
|
+
usually to rearrange Axes on the figure to produce a pleasing layout. This is
|
|
9
|
+
like a ``draw`` callback but with two differences. First, when printing we
|
|
10
|
+
disable the layout engine for the final draw. Second, it is useful to know the
|
|
11
|
+
layout engine while the figure is being created. In particular, colorbars are
|
|
12
|
+
made differently with different layout engines (for historical reasons).
|
|
13
|
+
|
|
14
|
+
Matplotlib has two built-in layout engines:
|
|
15
|
+
|
|
16
|
+
- `.TightLayoutEngine` was the first layout engine added to Matplotlib.
|
|
17
|
+
See also :ref:`tight_layout_guide`.
|
|
18
|
+
- `.ConstrainedLayoutEngine` is more modern and generally gives better results.
|
|
19
|
+
See also :ref:`constrainedlayout_guide`.
|
|
20
|
+
|
|
21
|
+
Third parties can create their own layout engine by subclassing `.LayoutEngine`.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from contextlib import nullcontext
|
|
25
|
+
|
|
26
|
+
import matplotlib_rs as mpl
|
|
27
|
+
|
|
28
|
+
from matplotlib_rs._constrained_layout import do_constrained_layout
|
|
29
|
+
from matplotlib_rs._tight_layout import (get_subplotspec_list,
|
|
30
|
+
get_tight_layout_figure)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class LayoutEngine:
|
|
34
|
+
"""
|
|
35
|
+
Base class for Matplotlib layout engines.
|
|
36
|
+
|
|
37
|
+
A layout engine can be passed to a figure at instantiation or at any time
|
|
38
|
+
with `~.figure.Figure.set_layout_engine`. Once attached to a figure, the
|
|
39
|
+
layout engine ``execute`` function is called at draw time by
|
|
40
|
+
`~.figure.Figure.draw`, providing a special draw-time hook.
|
|
41
|
+
|
|
42
|
+
.. note::
|
|
43
|
+
|
|
44
|
+
However, note that layout engines affect the creation of colorbars, so
|
|
45
|
+
`~.figure.Figure.set_layout_engine` should be called before any
|
|
46
|
+
colorbars are created.
|
|
47
|
+
|
|
48
|
+
Currently, there are two properties of `LayoutEngine` classes that are
|
|
49
|
+
consulted while manipulating the figure:
|
|
50
|
+
|
|
51
|
+
- ``engine.colorbar_gridspec`` tells `.Figure.colorbar` whether to make the
|
|
52
|
+
axes using the gridspec method (see `.colorbar.make_axes_gridspec`) or
|
|
53
|
+
not (see `.colorbar.make_axes`);
|
|
54
|
+
- ``engine.adjust_compatible`` stops `.Figure.subplots_adjust` from being
|
|
55
|
+
run if it is not compatible with the layout engine.
|
|
56
|
+
|
|
57
|
+
To implement a custom `LayoutEngine`:
|
|
58
|
+
|
|
59
|
+
1. override ``_adjust_compatible`` and ``_colorbar_gridspec``
|
|
60
|
+
2. override `LayoutEngine.set` to update *self._params*
|
|
61
|
+
3. override `LayoutEngine.execute` with your implementation
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
# override these in subclass
|
|
65
|
+
_adjust_compatible = None
|
|
66
|
+
_colorbar_gridspec = None
|
|
67
|
+
|
|
68
|
+
def __init__(self, **kwargs):
|
|
69
|
+
super().__init__(**kwargs)
|
|
70
|
+
self._params = {}
|
|
71
|
+
|
|
72
|
+
def set(self, **kwargs):
|
|
73
|
+
"""
|
|
74
|
+
Set the parameters for the layout engine.
|
|
75
|
+
"""
|
|
76
|
+
raise NotImplementedError
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def colorbar_gridspec(self):
|
|
80
|
+
"""
|
|
81
|
+
Return a boolean if the layout engine creates colorbars using a
|
|
82
|
+
gridspec.
|
|
83
|
+
"""
|
|
84
|
+
if self._colorbar_gridspec is None:
|
|
85
|
+
raise NotImplementedError
|
|
86
|
+
return self._colorbar_gridspec
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def adjust_compatible(self):
|
|
90
|
+
"""
|
|
91
|
+
Return a boolean if the layout engine is compatible with
|
|
92
|
+
`~.Figure.subplots_adjust`.
|
|
93
|
+
"""
|
|
94
|
+
if self._adjust_compatible is None:
|
|
95
|
+
raise NotImplementedError
|
|
96
|
+
return self._adjust_compatible
|
|
97
|
+
|
|
98
|
+
def get(self):
|
|
99
|
+
"""
|
|
100
|
+
Return copy of the parameters for the layout engine.
|
|
101
|
+
"""
|
|
102
|
+
return dict(self._params)
|
|
103
|
+
|
|
104
|
+
def execute(self, fig):
|
|
105
|
+
"""
|
|
106
|
+
Execute the layout on the figure given by *fig*.
|
|
107
|
+
"""
|
|
108
|
+
# subclasses must implement this.
|
|
109
|
+
raise NotImplementedError
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class PlaceHolderLayoutEngine(LayoutEngine):
|
|
113
|
+
"""
|
|
114
|
+
This layout engine does not adjust the figure layout at all.
|
|
115
|
+
|
|
116
|
+
The purpose of this `.LayoutEngine` is to act as a placeholder when the user removes
|
|
117
|
+
a layout engine to ensure an incompatible `.LayoutEngine` cannot be set later.
|
|
118
|
+
|
|
119
|
+
Parameters
|
|
120
|
+
----------
|
|
121
|
+
adjust_compatible, colorbar_gridspec : bool
|
|
122
|
+
Allow the PlaceHolderLayoutEngine to mirror the behavior of whatever
|
|
123
|
+
layout engine it is replacing.
|
|
124
|
+
|
|
125
|
+
"""
|
|
126
|
+
def __init__(self, adjust_compatible, colorbar_gridspec, **kwargs):
|
|
127
|
+
self._adjust_compatible = adjust_compatible
|
|
128
|
+
self._colorbar_gridspec = colorbar_gridspec
|
|
129
|
+
super().__init__(**kwargs)
|
|
130
|
+
|
|
131
|
+
def execute(self, fig):
|
|
132
|
+
"""
|
|
133
|
+
Do nothing.
|
|
134
|
+
"""
|
|
135
|
+
return
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class TightLayoutEngine(LayoutEngine):
|
|
139
|
+
"""
|
|
140
|
+
Implements the ``tight_layout`` geometry management. See
|
|
141
|
+
:ref:`tight_layout_guide` for details.
|
|
142
|
+
"""
|
|
143
|
+
_adjust_compatible = True
|
|
144
|
+
_colorbar_gridspec = True
|
|
145
|
+
|
|
146
|
+
def __init__(self, *, pad=1.08, h_pad=None, w_pad=None,
|
|
147
|
+
rect=(0, 0, 1, 1), **kwargs):
|
|
148
|
+
"""
|
|
149
|
+
Initialize tight_layout engine.
|
|
150
|
+
|
|
151
|
+
Parameters
|
|
152
|
+
----------
|
|
153
|
+
pad : float, default: 1.08
|
|
154
|
+
Padding between the figure edge and the edges of subplots, as a
|
|
155
|
+
fraction of the font size.
|
|
156
|
+
h_pad, w_pad : float
|
|
157
|
+
Padding (height/width) between edges of adjacent subplots.
|
|
158
|
+
Defaults to *pad*.
|
|
159
|
+
rect : tuple (left, bottom, right, top), default: (0, 0, 1, 1).
|
|
160
|
+
rectangle in normalized figure coordinates that the subplots
|
|
161
|
+
(including labels) will fit into.
|
|
162
|
+
"""
|
|
163
|
+
super().__init__(**kwargs)
|
|
164
|
+
for td in ['pad', 'h_pad', 'w_pad', 'rect']:
|
|
165
|
+
# initialize these in case None is passed in above:
|
|
166
|
+
self._params[td] = None
|
|
167
|
+
self.set(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
|
|
168
|
+
|
|
169
|
+
def execute(self, fig):
|
|
170
|
+
"""
|
|
171
|
+
Execute tight_layout.
|
|
172
|
+
|
|
173
|
+
This decides the subplot parameters given the padding that
|
|
174
|
+
will allow the Axes labels to not be covered by other labels
|
|
175
|
+
and Axes.
|
|
176
|
+
|
|
177
|
+
Parameters
|
|
178
|
+
----------
|
|
179
|
+
fig : `.Figure` to perform layout on.
|
|
180
|
+
|
|
181
|
+
See Also
|
|
182
|
+
--------
|
|
183
|
+
.figure.Figure.tight_layout
|
|
184
|
+
.pyplot.tight_layout
|
|
185
|
+
"""
|
|
186
|
+
info = self._params
|
|
187
|
+
renderer = fig._get_renderer()
|
|
188
|
+
with getattr(renderer, "_draw_disabled", nullcontext)():
|
|
189
|
+
kwargs = get_tight_layout_figure(
|
|
190
|
+
fig, fig.axes, get_subplotspec_list(fig.axes), renderer,
|
|
191
|
+
pad=info['pad'], h_pad=info['h_pad'], w_pad=info['w_pad'],
|
|
192
|
+
rect=info['rect'])
|
|
193
|
+
if kwargs:
|
|
194
|
+
fig.subplots_adjust(**kwargs)
|
|
195
|
+
|
|
196
|
+
def set(self, *, pad=None, w_pad=None, h_pad=None, rect=None):
|
|
197
|
+
"""
|
|
198
|
+
Set the pads for tight_layout.
|
|
199
|
+
|
|
200
|
+
Parameters
|
|
201
|
+
----------
|
|
202
|
+
pad : float
|
|
203
|
+
Padding between the figure edge and the edges of subplots, as a
|
|
204
|
+
fraction of the font size.
|
|
205
|
+
w_pad, h_pad : float
|
|
206
|
+
Padding (width/height) between edges of adjacent subplots.
|
|
207
|
+
Defaults to *pad*.
|
|
208
|
+
rect : tuple (left, bottom, right, top)
|
|
209
|
+
rectangle in normalized figure coordinates that the subplots
|
|
210
|
+
(including labels) will fit into.
|
|
211
|
+
"""
|
|
212
|
+
for td in self.set.__kwdefaults__:
|
|
213
|
+
if locals()[td] is not None:
|
|
214
|
+
self._params[td] = locals()[td]
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class ConstrainedLayoutEngine(LayoutEngine):
|
|
218
|
+
"""
|
|
219
|
+
Implements the ``constrained_layout`` geometry management. See
|
|
220
|
+
:ref:`constrainedlayout_guide` for details.
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
_adjust_compatible = False
|
|
224
|
+
_colorbar_gridspec = False
|
|
225
|
+
|
|
226
|
+
def __init__(self, *, h_pad=None, w_pad=None,
|
|
227
|
+
hspace=None, wspace=None, rect=(0, 0, 1, 1),
|
|
228
|
+
compress=False, **kwargs):
|
|
229
|
+
"""
|
|
230
|
+
Initialize ``constrained_layout`` settings.
|
|
231
|
+
|
|
232
|
+
Parameters
|
|
233
|
+
----------
|
|
234
|
+
h_pad, w_pad : float
|
|
235
|
+
Padding around the Axes elements in inches.
|
|
236
|
+
Default to :rc:`figure.constrained_layout.h_pad` and
|
|
237
|
+
:rc:`figure.constrained_layout.w_pad`.
|
|
238
|
+
hspace, wspace : float
|
|
239
|
+
Fraction of the figure to dedicate to space between the
|
|
240
|
+
axes. These are evenly spread between the gaps between the Axes.
|
|
241
|
+
A value of 0.2 for a three-column layout would have a space
|
|
242
|
+
of 0.1 of the figure width between each column.
|
|
243
|
+
If h/wspace < h/w_pad, then the pads are used instead.
|
|
244
|
+
Default to :rc:`figure.constrained_layout.hspace` and
|
|
245
|
+
:rc:`figure.constrained_layout.wspace`.
|
|
246
|
+
rect : tuple of 4 floats
|
|
247
|
+
Rectangle in figure coordinates to perform constrained layout in
|
|
248
|
+
(left, bottom, width, height), each from 0-1.
|
|
249
|
+
compress : bool
|
|
250
|
+
Whether to shift Axes so that white space in between them is
|
|
251
|
+
removed. This is useful for simple grids of fixed-aspect Axes (e.g.
|
|
252
|
+
a grid of images). See :ref:`compressed_layout`.
|
|
253
|
+
"""
|
|
254
|
+
super().__init__(**kwargs)
|
|
255
|
+
# set the defaults:
|
|
256
|
+
self.set(w_pad=mpl.rcParams['figure.constrained_layout.w_pad'],
|
|
257
|
+
h_pad=mpl.rcParams['figure.constrained_layout.h_pad'],
|
|
258
|
+
wspace=mpl.rcParams['figure.constrained_layout.wspace'],
|
|
259
|
+
hspace=mpl.rcParams['figure.constrained_layout.hspace'],
|
|
260
|
+
rect=(0, 0, 1, 1))
|
|
261
|
+
# set anything that was passed in (None will be ignored):
|
|
262
|
+
self.set(w_pad=w_pad, h_pad=h_pad, wspace=wspace, hspace=hspace,
|
|
263
|
+
rect=rect)
|
|
264
|
+
self._compress = compress
|
|
265
|
+
|
|
266
|
+
def execute(self, fig):
|
|
267
|
+
"""
|
|
268
|
+
Perform constrained_layout and move and resize Axes accordingly.
|
|
269
|
+
|
|
270
|
+
Parameters
|
|
271
|
+
----------
|
|
272
|
+
fig : `.Figure` to perform layout on.
|
|
273
|
+
"""
|
|
274
|
+
width, height = fig.get_size_inches()
|
|
275
|
+
# pads are relative to the current state of the figure...
|
|
276
|
+
w_pad = self._params['w_pad'] / width
|
|
277
|
+
h_pad = self._params['h_pad'] / height
|
|
278
|
+
|
|
279
|
+
return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
|
|
280
|
+
wspace=self._params['wspace'],
|
|
281
|
+
hspace=self._params['hspace'],
|
|
282
|
+
rect=self._params['rect'],
|
|
283
|
+
compress=self._compress)
|
|
284
|
+
|
|
285
|
+
def set(self, *, h_pad=None, w_pad=None,
|
|
286
|
+
hspace=None, wspace=None, rect=None):
|
|
287
|
+
"""
|
|
288
|
+
Set the pads for constrained_layout.
|
|
289
|
+
|
|
290
|
+
Parameters
|
|
291
|
+
----------
|
|
292
|
+
h_pad, w_pad : float
|
|
293
|
+
Padding around the Axes elements in inches.
|
|
294
|
+
Default to :rc:`figure.constrained_layout.h_pad` and
|
|
295
|
+
:rc:`figure.constrained_layout.w_pad`.
|
|
296
|
+
hspace, wspace : float
|
|
297
|
+
Fraction of the figure to dedicate to space between the
|
|
298
|
+
axes. These are evenly spread between the gaps between the Axes.
|
|
299
|
+
A value of 0.2 for a three-column layout would have a space
|
|
300
|
+
of 0.1 of the figure width between each column.
|
|
301
|
+
If h/wspace < h/w_pad, then the pads are used instead.
|
|
302
|
+
Default to :rc:`figure.constrained_layout.hspace` and
|
|
303
|
+
:rc:`figure.constrained_layout.wspace`.
|
|
304
|
+
rect : tuple of 4 floats
|
|
305
|
+
Rectangle in figure coordinates to perform constrained layout in
|
|
306
|
+
(left, bottom, width, height), each from 0-1.
|
|
307
|
+
"""
|
|
308
|
+
for td in self.set.__kwdefaults__:
|
|
309
|
+
if locals()[td] is not None:
|
|
310
|
+
self._params[td] = locals()[td]
|