matplotlib-rs 0.0.8__cp313-cp313-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.cp313-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,525 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
A collection of functions and objects for creating or placing inset axes.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from matplotlib_rs import _api, _docstring
|
|
7
|
+
from matplotlib_rs.offsetbox import AnchoredOffsetbox
|
|
8
|
+
from matplotlib_rs.patches import Patch, Rectangle
|
|
9
|
+
from matplotlib_rs.path import Path
|
|
10
|
+
from matplotlib_rs.transforms import Bbox
|
|
11
|
+
from matplotlib_rs.transforms import IdentityTransform, TransformedBbox
|
|
12
|
+
|
|
13
|
+
from . import axes_size as Size
|
|
14
|
+
from .parasite_axes import HostAxes
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AnchoredLocatorBase(AnchoredOffsetbox):
|
|
18
|
+
def __init__(self, bbox_to_anchor, offsetbox, loc,
|
|
19
|
+
borderpad=0.5, bbox_transform=None):
|
|
20
|
+
super().__init__(
|
|
21
|
+
loc, pad=0., child=None, borderpad=borderpad,
|
|
22
|
+
bbox_to_anchor=bbox_to_anchor, bbox_transform=bbox_transform
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def draw(self, renderer):
|
|
26
|
+
raise RuntimeError("No draw method should be called")
|
|
27
|
+
|
|
28
|
+
def __call__(self, ax, renderer):
|
|
29
|
+
fig = ax.get_figure(root=False)
|
|
30
|
+
if renderer is None:
|
|
31
|
+
renderer = fig._get_renderer()
|
|
32
|
+
self.axes = ax
|
|
33
|
+
bbox = self.get_window_extent(renderer)
|
|
34
|
+
px, py = self.get_offset(bbox.width, bbox.height, 0, 0, renderer)
|
|
35
|
+
bbox_canvas = Bbox.from_bounds(px, py, bbox.width, bbox.height)
|
|
36
|
+
tr = fig.transSubfigure.inverted()
|
|
37
|
+
return TransformedBbox(bbox_canvas, tr)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class AnchoredSizeLocator(AnchoredLocatorBase):
|
|
41
|
+
def __init__(self, bbox_to_anchor, x_size, y_size, loc,
|
|
42
|
+
borderpad=0.5, bbox_transform=None):
|
|
43
|
+
super().__init__(
|
|
44
|
+
bbox_to_anchor, None, loc,
|
|
45
|
+
borderpad=borderpad, bbox_transform=bbox_transform
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
self.x_size = Size.from_any(x_size)
|
|
49
|
+
self.y_size = Size.from_any(y_size)
|
|
50
|
+
|
|
51
|
+
def get_bbox(self, renderer):
|
|
52
|
+
bbox = self.get_bbox_to_anchor()
|
|
53
|
+
dpi = renderer.points_to_pixels(72.)
|
|
54
|
+
|
|
55
|
+
r, a = self.x_size.get_size(renderer)
|
|
56
|
+
width = bbox.width * r + a * dpi
|
|
57
|
+
r, a = self.y_size.get_size(renderer)
|
|
58
|
+
height = bbox.height * r + a * dpi
|
|
59
|
+
|
|
60
|
+
fontsize = renderer.points_to_pixels(self.prop.get_size_in_points())
|
|
61
|
+
pad = self.pad * fontsize
|
|
62
|
+
|
|
63
|
+
return Bbox.from_bounds(0, 0, width, height).padded(pad)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class AnchoredZoomLocator(AnchoredLocatorBase):
|
|
67
|
+
def __init__(self, parent_axes, zoom, loc,
|
|
68
|
+
borderpad=0.5,
|
|
69
|
+
bbox_to_anchor=None,
|
|
70
|
+
bbox_transform=None):
|
|
71
|
+
self.parent_axes = parent_axes
|
|
72
|
+
self.zoom = zoom
|
|
73
|
+
if bbox_to_anchor is None:
|
|
74
|
+
bbox_to_anchor = parent_axes.bbox
|
|
75
|
+
super().__init__(
|
|
76
|
+
bbox_to_anchor, None, loc, borderpad=borderpad,
|
|
77
|
+
bbox_transform=bbox_transform)
|
|
78
|
+
|
|
79
|
+
def get_bbox(self, renderer):
|
|
80
|
+
bb = self.parent_axes.transData.transform_bbox(self.axes.viewLim)
|
|
81
|
+
fontsize = renderer.points_to_pixels(self.prop.get_size_in_points())
|
|
82
|
+
pad = self.pad * fontsize
|
|
83
|
+
return (
|
|
84
|
+
Bbox.from_bounds(
|
|
85
|
+
0, 0, abs(bb.width * self.zoom), abs(bb.height * self.zoom))
|
|
86
|
+
.padded(pad))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class BboxPatch(Patch):
|
|
90
|
+
@_docstring.interpd
|
|
91
|
+
def __init__(self, bbox, **kwargs):
|
|
92
|
+
"""
|
|
93
|
+
Patch showing the shape bounded by a Bbox.
|
|
94
|
+
|
|
95
|
+
Parameters
|
|
96
|
+
----------
|
|
97
|
+
bbox : `~matplotlib.transforms.Bbox`
|
|
98
|
+
Bbox to use for the extents of this patch.
|
|
99
|
+
|
|
100
|
+
**kwargs
|
|
101
|
+
Patch properties. Valid arguments include:
|
|
102
|
+
|
|
103
|
+
%(Patch:kwdoc)s
|
|
104
|
+
"""
|
|
105
|
+
if "transform" in kwargs:
|
|
106
|
+
raise ValueError("transform should not be set")
|
|
107
|
+
|
|
108
|
+
kwargs["transform"] = IdentityTransform()
|
|
109
|
+
super().__init__(**kwargs)
|
|
110
|
+
self.bbox = bbox
|
|
111
|
+
|
|
112
|
+
def get_path(self):
|
|
113
|
+
# docstring inherited
|
|
114
|
+
x0, y0, x1, y1 = self.bbox.extents
|
|
115
|
+
return Path._create_closed([(x0, y0), (x1, y0), (x1, y1), (x0, y1)])
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class BboxConnector(Patch):
|
|
119
|
+
@staticmethod
|
|
120
|
+
def get_bbox_edge_pos(bbox, loc):
|
|
121
|
+
"""
|
|
122
|
+
Return the ``(x, y)`` coordinates of corner *loc* of *bbox*; parameters
|
|
123
|
+
behave as documented for the `.BboxConnector` constructor.
|
|
124
|
+
"""
|
|
125
|
+
x0, y0, x1, y1 = bbox.extents
|
|
126
|
+
if loc == 1:
|
|
127
|
+
return x1, y1
|
|
128
|
+
elif loc == 2:
|
|
129
|
+
return x0, y1
|
|
130
|
+
elif loc == 3:
|
|
131
|
+
return x0, y0
|
|
132
|
+
elif loc == 4:
|
|
133
|
+
return x1, y0
|
|
134
|
+
|
|
135
|
+
@staticmethod
|
|
136
|
+
def connect_bbox(bbox1, bbox2, loc1, loc2=None):
|
|
137
|
+
"""
|
|
138
|
+
Construct a `.Path` connecting corner *loc1* of *bbox1* to corner
|
|
139
|
+
*loc2* of *bbox2*, where parameters behave as documented as for the
|
|
140
|
+
`.BboxConnector` constructor.
|
|
141
|
+
"""
|
|
142
|
+
if isinstance(bbox1, Rectangle):
|
|
143
|
+
bbox1 = TransformedBbox(Bbox.unit(), bbox1.get_transform())
|
|
144
|
+
if isinstance(bbox2, Rectangle):
|
|
145
|
+
bbox2 = TransformedBbox(Bbox.unit(), bbox2.get_transform())
|
|
146
|
+
if loc2 is None:
|
|
147
|
+
loc2 = loc1
|
|
148
|
+
x1, y1 = BboxConnector.get_bbox_edge_pos(bbox1, loc1)
|
|
149
|
+
x2, y2 = BboxConnector.get_bbox_edge_pos(bbox2, loc2)
|
|
150
|
+
return Path([[x1, y1], [x2, y2]])
|
|
151
|
+
|
|
152
|
+
@_docstring.interpd
|
|
153
|
+
def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
|
|
154
|
+
"""
|
|
155
|
+
Connect two bboxes with a straight line.
|
|
156
|
+
|
|
157
|
+
Parameters
|
|
158
|
+
----------
|
|
159
|
+
bbox1, bbox2 : `~matplotlib.transforms.Bbox`
|
|
160
|
+
Bounding boxes to connect.
|
|
161
|
+
|
|
162
|
+
loc1, loc2 : {1, 2, 3, 4}
|
|
163
|
+
Corner of *bbox1* and *bbox2* to draw the line. Valid values are::
|
|
164
|
+
|
|
165
|
+
'upper right' : 1,
|
|
166
|
+
'upper left' : 2,
|
|
167
|
+
'lower left' : 3,
|
|
168
|
+
'lower right' : 4
|
|
169
|
+
|
|
170
|
+
*loc2* is optional and defaults to *loc1*.
|
|
171
|
+
|
|
172
|
+
**kwargs
|
|
173
|
+
Patch properties for the line drawn. Valid arguments include:
|
|
174
|
+
|
|
175
|
+
%(Patch:kwdoc)s
|
|
176
|
+
"""
|
|
177
|
+
if "transform" in kwargs:
|
|
178
|
+
raise ValueError("transform should not be set")
|
|
179
|
+
|
|
180
|
+
kwargs["transform"] = IdentityTransform()
|
|
181
|
+
kwargs.setdefault(
|
|
182
|
+
"fill", bool({'fc', 'facecolor', 'color'}.intersection(kwargs)))
|
|
183
|
+
super().__init__(**kwargs)
|
|
184
|
+
self.bbox1 = bbox1
|
|
185
|
+
self.bbox2 = bbox2
|
|
186
|
+
self.loc1 = loc1
|
|
187
|
+
self.loc2 = loc2
|
|
188
|
+
|
|
189
|
+
def get_path(self):
|
|
190
|
+
# docstring inherited
|
|
191
|
+
return self.connect_bbox(self.bbox1, self.bbox2,
|
|
192
|
+
self.loc1, self.loc2)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class BboxConnectorPatch(BboxConnector):
|
|
196
|
+
@_docstring.interpd
|
|
197
|
+
def __init__(self, bbox1, bbox2, loc1a, loc2a, loc1b, loc2b, **kwargs):
|
|
198
|
+
"""
|
|
199
|
+
Connect two bboxes with a quadrilateral.
|
|
200
|
+
|
|
201
|
+
The quadrilateral is specified by two lines that start and end at
|
|
202
|
+
corners of the bboxes. The four sides of the quadrilateral are defined
|
|
203
|
+
by the two lines given, the line between the two corners specified in
|
|
204
|
+
*bbox1* and the line between the two corners specified in *bbox2*.
|
|
205
|
+
|
|
206
|
+
Parameters
|
|
207
|
+
----------
|
|
208
|
+
bbox1, bbox2 : `~matplotlib.transforms.Bbox`
|
|
209
|
+
Bounding boxes to connect.
|
|
210
|
+
|
|
211
|
+
loc1a, loc2a, loc1b, loc2b : {1, 2, 3, 4}
|
|
212
|
+
The first line connects corners *loc1a* of *bbox1* and *loc2a* of
|
|
213
|
+
*bbox2*; the second line connects corners *loc1b* of *bbox1* and
|
|
214
|
+
*loc2b* of *bbox2*. Valid values are::
|
|
215
|
+
|
|
216
|
+
'upper right' : 1,
|
|
217
|
+
'upper left' : 2,
|
|
218
|
+
'lower left' : 3,
|
|
219
|
+
'lower right' : 4
|
|
220
|
+
|
|
221
|
+
**kwargs
|
|
222
|
+
Patch properties for the line drawn:
|
|
223
|
+
|
|
224
|
+
%(Patch:kwdoc)s
|
|
225
|
+
"""
|
|
226
|
+
if "transform" in kwargs:
|
|
227
|
+
raise ValueError("transform should not be set")
|
|
228
|
+
super().__init__(bbox1, bbox2, loc1a, loc2a, **kwargs)
|
|
229
|
+
self.loc1b = loc1b
|
|
230
|
+
self.loc2b = loc2b
|
|
231
|
+
|
|
232
|
+
def get_path(self):
|
|
233
|
+
# docstring inherited
|
|
234
|
+
path1 = self.connect_bbox(self.bbox1, self.bbox2, self.loc1, self.loc2)
|
|
235
|
+
path2 = self.connect_bbox(self.bbox2, self.bbox1,
|
|
236
|
+
self.loc2b, self.loc1b)
|
|
237
|
+
path_merged = [*path1.vertices, *path2.vertices, path1.vertices[0]]
|
|
238
|
+
return Path(path_merged)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def _add_inset_axes(parent_axes, axes_class, axes_kwargs, axes_locator):
|
|
242
|
+
"""Helper function to add an inset axes and disable navigation in it."""
|
|
243
|
+
if axes_class is None:
|
|
244
|
+
axes_class = HostAxes
|
|
245
|
+
if axes_kwargs is None:
|
|
246
|
+
axes_kwargs = {}
|
|
247
|
+
fig = parent_axes.get_figure(root=False)
|
|
248
|
+
inset_axes = axes_class(
|
|
249
|
+
fig, parent_axes.get_position(),
|
|
250
|
+
**{"navigate": False, **axes_kwargs, "axes_locator": axes_locator})
|
|
251
|
+
return fig.add_axes(inset_axes)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
@_docstring.interpd
|
|
255
|
+
def inset_axes(parent_axes, width, height, loc='upper right',
|
|
256
|
+
bbox_to_anchor=None, bbox_transform=None,
|
|
257
|
+
axes_class=None, axes_kwargs=None,
|
|
258
|
+
borderpad=0.5):
|
|
259
|
+
"""
|
|
260
|
+
Create an inset axes with a given width and height.
|
|
261
|
+
|
|
262
|
+
Both sizes used can be specified either in inches or percentage.
|
|
263
|
+
For example,::
|
|
264
|
+
|
|
265
|
+
inset_axes(parent_axes, width='40%%', height='30%%', loc='lower left')
|
|
266
|
+
|
|
267
|
+
creates in inset axes in the lower left corner of *parent_axes* which spans
|
|
268
|
+
over 30%% in height and 40%% in width of the *parent_axes*. Since the usage
|
|
269
|
+
of `.inset_axes` may become slightly tricky when exceeding such standard
|
|
270
|
+
cases, it is recommended to read :doc:`the examples
|
|
271
|
+
</gallery/axes_grid1/inset_locator_demo>`.
|
|
272
|
+
|
|
273
|
+
Notes
|
|
274
|
+
-----
|
|
275
|
+
The meaning of *bbox_to_anchor* and *bbox_to_transform* is interpreted
|
|
276
|
+
differently from that of legend. The value of bbox_to_anchor
|
|
277
|
+
(or the return value of its get_points method; the default is
|
|
278
|
+
*parent_axes.bbox*) is transformed by the bbox_transform (the default
|
|
279
|
+
is Identity transform) and then interpreted as points in the pixel
|
|
280
|
+
coordinate (which is dpi dependent).
|
|
281
|
+
|
|
282
|
+
Thus, following three calls are identical and creates an inset axes
|
|
283
|
+
with respect to the *parent_axes*::
|
|
284
|
+
|
|
285
|
+
axins = inset_axes(parent_axes, "30%%", "40%%")
|
|
286
|
+
axins = inset_axes(parent_axes, "30%%", "40%%",
|
|
287
|
+
bbox_to_anchor=parent_axes.bbox)
|
|
288
|
+
axins = inset_axes(parent_axes, "30%%", "40%%",
|
|
289
|
+
bbox_to_anchor=(0, 0, 1, 1),
|
|
290
|
+
bbox_transform=parent_axes.transAxes)
|
|
291
|
+
|
|
292
|
+
Parameters
|
|
293
|
+
----------
|
|
294
|
+
parent_axes : `matplotlib.axes.Axes`
|
|
295
|
+
Axes to place the inset axes.
|
|
296
|
+
|
|
297
|
+
width, height : float or str
|
|
298
|
+
Size of the inset axes to create. If a float is provided, it is
|
|
299
|
+
the size in inches, e.g. *width=1.3*. If a string is provided, it is
|
|
300
|
+
the size in relative units, e.g. *width='40%%'*. By default, i.e. if
|
|
301
|
+
neither *bbox_to_anchor* nor *bbox_transform* are specified, those
|
|
302
|
+
are relative to the parent_axes. Otherwise, they are to be understood
|
|
303
|
+
relative to the bounding box provided via *bbox_to_anchor*.
|
|
304
|
+
|
|
305
|
+
loc : str, default: 'upper right'
|
|
306
|
+
Location to place the inset axes. Valid locations are
|
|
307
|
+
'upper left', 'upper center', 'upper right',
|
|
308
|
+
'center left', 'center', 'center right',
|
|
309
|
+
'lower left', 'lower center', 'lower right'.
|
|
310
|
+
For backward compatibility, numeric values are accepted as well.
|
|
311
|
+
See the parameter *loc* of `.Legend` for details.
|
|
312
|
+
|
|
313
|
+
bbox_to_anchor : tuple or `~matplotlib.transforms.BboxBase`, optional
|
|
314
|
+
Bbox that the inset axes will be anchored to. If None,
|
|
315
|
+
a tuple of (0, 0, 1, 1) is used if *bbox_transform* is set
|
|
316
|
+
to *parent_axes.transAxes* or *parent_axes.figure.transFigure*.
|
|
317
|
+
Otherwise, *parent_axes.bbox* is used. If a tuple, can be either
|
|
318
|
+
[left, bottom, width, height], or [left, bottom].
|
|
319
|
+
If the kwargs *width* and/or *height* are specified in relative units,
|
|
320
|
+
the 2-tuple [left, bottom] cannot be used. Note that,
|
|
321
|
+
unless *bbox_transform* is set, the units of the bounding box
|
|
322
|
+
are interpreted in the pixel coordinate. When using *bbox_to_anchor*
|
|
323
|
+
with tuple, it almost always makes sense to also specify
|
|
324
|
+
a *bbox_transform*. This might often be the axes transform
|
|
325
|
+
*parent_axes.transAxes*.
|
|
326
|
+
|
|
327
|
+
bbox_transform : `~matplotlib.transforms.Transform`, optional
|
|
328
|
+
Transformation for the bbox that contains the inset axes.
|
|
329
|
+
If None, a `.transforms.IdentityTransform` is used. The value
|
|
330
|
+
of *bbox_to_anchor* (or the return value of its get_points method)
|
|
331
|
+
is transformed by the *bbox_transform* and then interpreted
|
|
332
|
+
as points in the pixel coordinate (which is dpi dependent).
|
|
333
|
+
You may provide *bbox_to_anchor* in some normalized coordinate,
|
|
334
|
+
and give an appropriate transform (e.g., *parent_axes.transAxes*).
|
|
335
|
+
|
|
336
|
+
axes_class : `~matplotlib.axes.Axes` type, default: `.HostAxes`
|
|
337
|
+
The type of the newly created inset axes.
|
|
338
|
+
|
|
339
|
+
axes_kwargs : dict, optional
|
|
340
|
+
Keyword arguments to pass to the constructor of the inset axes.
|
|
341
|
+
Valid arguments include:
|
|
342
|
+
|
|
343
|
+
%(Axes:kwdoc)s
|
|
344
|
+
|
|
345
|
+
borderpad : float or (float, float), default: 0.5
|
|
346
|
+
Padding between inset axes and the bbox_to_anchor.
|
|
347
|
+
If a float, the same padding is used for both x and y.
|
|
348
|
+
If a tuple of two floats, it specifies the (x, y) padding.
|
|
349
|
+
The units are axes font size, i.e. for a default font size of 10 points
|
|
350
|
+
*borderpad = 0.5* is equivalent to a padding of 5 points.
|
|
351
|
+
|
|
352
|
+
.. versionadded:: 3.11
|
|
353
|
+
The *borderpad* parameter now accepts a tuple of (x, y) paddings.
|
|
354
|
+
|
|
355
|
+
Returns
|
|
356
|
+
-------
|
|
357
|
+
inset_axes : *axes_class*
|
|
358
|
+
Inset axes object created.
|
|
359
|
+
"""
|
|
360
|
+
|
|
361
|
+
if (bbox_transform in [parent_axes.transAxes,
|
|
362
|
+
parent_axes.get_figure(root=False).transFigure]
|
|
363
|
+
and bbox_to_anchor is None):
|
|
364
|
+
_api.warn_external("Using the axes or figure transform requires a "
|
|
365
|
+
"bounding box in the respective coordinates. "
|
|
366
|
+
"Using bbox_to_anchor=(0, 0, 1, 1) now.")
|
|
367
|
+
bbox_to_anchor = (0, 0, 1, 1)
|
|
368
|
+
if bbox_to_anchor is None:
|
|
369
|
+
bbox_to_anchor = parent_axes.bbox
|
|
370
|
+
if (isinstance(bbox_to_anchor, tuple) and
|
|
371
|
+
(isinstance(width, str) or isinstance(height, str))):
|
|
372
|
+
if len(bbox_to_anchor) != 4:
|
|
373
|
+
raise ValueError("Using relative units for width or height "
|
|
374
|
+
"requires to provide a 4-tuple or a "
|
|
375
|
+
"`Bbox` instance to `bbox_to_anchor.")
|
|
376
|
+
return _add_inset_axes(
|
|
377
|
+
parent_axes, axes_class, axes_kwargs,
|
|
378
|
+
AnchoredSizeLocator(
|
|
379
|
+
bbox_to_anchor, width, height, loc=loc,
|
|
380
|
+
bbox_transform=bbox_transform, borderpad=borderpad))
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
@_docstring.interpd
|
|
384
|
+
def zoomed_inset_axes(parent_axes, zoom, loc='upper right',
|
|
385
|
+
bbox_to_anchor=None, bbox_transform=None,
|
|
386
|
+
axes_class=None, axes_kwargs=None,
|
|
387
|
+
borderpad=0.5):
|
|
388
|
+
"""
|
|
389
|
+
Create an anchored inset axes by scaling a parent axes. For usage, also see
|
|
390
|
+
:doc:`the examples </gallery/axes_grid1/inset_locator_demo2>`.
|
|
391
|
+
|
|
392
|
+
Parameters
|
|
393
|
+
----------
|
|
394
|
+
parent_axes : `~matplotlib.axes.Axes`
|
|
395
|
+
Axes to place the inset axes.
|
|
396
|
+
|
|
397
|
+
zoom : float
|
|
398
|
+
Scaling factor of the data axes. *zoom* > 1 will enlarge the
|
|
399
|
+
coordinates (i.e., "zoomed in"), while *zoom* < 1 will shrink the
|
|
400
|
+
coordinates (i.e., "zoomed out").
|
|
401
|
+
|
|
402
|
+
loc : str, default: 'upper right'
|
|
403
|
+
Location to place the inset axes. Valid locations are
|
|
404
|
+
'upper left', 'upper center', 'upper right',
|
|
405
|
+
'center left', 'center', 'center right',
|
|
406
|
+
'lower left', 'lower center', 'lower right'.
|
|
407
|
+
For backward compatibility, numeric values are accepted as well.
|
|
408
|
+
See the parameter *loc* of `.Legend` for details.
|
|
409
|
+
|
|
410
|
+
bbox_to_anchor : tuple or `~matplotlib.transforms.BboxBase`, optional
|
|
411
|
+
Bbox that the inset axes will be anchored to. If None,
|
|
412
|
+
*parent_axes.bbox* is used. If a tuple, can be either
|
|
413
|
+
[left, bottom, width, height], or [left, bottom].
|
|
414
|
+
If the kwargs *width* and/or *height* are specified in relative units,
|
|
415
|
+
the 2-tuple [left, bottom] cannot be used. Note that
|
|
416
|
+
the units of the bounding box are determined through the transform
|
|
417
|
+
in use. When using *bbox_to_anchor* it almost always makes sense to
|
|
418
|
+
also specify a *bbox_transform*. This might often be the axes transform
|
|
419
|
+
*parent_axes.transAxes*.
|
|
420
|
+
|
|
421
|
+
bbox_transform : `~matplotlib.transforms.Transform`, optional
|
|
422
|
+
Transformation for the bbox that contains the inset axes.
|
|
423
|
+
If None, a `.transforms.IdentityTransform` is used (i.e. pixel
|
|
424
|
+
coordinates). This is useful when not providing any argument to
|
|
425
|
+
*bbox_to_anchor*. When using *bbox_to_anchor* it almost always makes
|
|
426
|
+
sense to also specify a *bbox_transform*. This might often be the
|
|
427
|
+
axes transform *parent_axes.transAxes*. Inversely, when specifying
|
|
428
|
+
the axes- or figure-transform here, be aware that not specifying
|
|
429
|
+
*bbox_to_anchor* will use *parent_axes.bbox*, the units of which are
|
|
430
|
+
in display (pixel) coordinates.
|
|
431
|
+
|
|
432
|
+
axes_class : `~matplotlib.axes.Axes` type, default: `.HostAxes`
|
|
433
|
+
The type of the newly created inset axes.
|
|
434
|
+
|
|
435
|
+
axes_kwargs : dict, optional
|
|
436
|
+
Keyword arguments to pass to the constructor of the inset axes.
|
|
437
|
+
Valid arguments include:
|
|
438
|
+
|
|
439
|
+
%(Axes:kwdoc)s
|
|
440
|
+
|
|
441
|
+
borderpad : float, default: 0.5
|
|
442
|
+
Padding between inset axes and the bbox_to_anchor.
|
|
443
|
+
The units are axes font size, i.e. for a default font size of 10 points
|
|
444
|
+
*borderpad = 0.5* is equivalent to a padding of 5 points.
|
|
445
|
+
|
|
446
|
+
Returns
|
|
447
|
+
-------
|
|
448
|
+
inset_axes : *axes_class*
|
|
449
|
+
Inset axes object created.
|
|
450
|
+
"""
|
|
451
|
+
|
|
452
|
+
return _add_inset_axes(
|
|
453
|
+
parent_axes, axes_class, axes_kwargs,
|
|
454
|
+
AnchoredZoomLocator(
|
|
455
|
+
parent_axes, zoom=zoom, loc=loc,
|
|
456
|
+
bbox_to_anchor=bbox_to_anchor, bbox_transform=bbox_transform,
|
|
457
|
+
borderpad=borderpad))
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
class _TransformedBboxWithCallback(TransformedBbox):
|
|
461
|
+
"""
|
|
462
|
+
Variant of `.TransformBbox` which calls *callback* before returning points.
|
|
463
|
+
|
|
464
|
+
Used by `.mark_inset` to unstale the parent axes' viewlim as needed.
|
|
465
|
+
"""
|
|
466
|
+
|
|
467
|
+
def __init__(self, *args, callback, **kwargs):
|
|
468
|
+
super().__init__(*args, **kwargs)
|
|
469
|
+
self._callback = callback
|
|
470
|
+
|
|
471
|
+
def get_points(self):
|
|
472
|
+
self._callback()
|
|
473
|
+
return super().get_points()
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
@_docstring.interpd
|
|
477
|
+
def mark_inset(parent_axes, inset_axes, loc1, loc2, **kwargs):
|
|
478
|
+
"""
|
|
479
|
+
Draw a box to mark the location of an area represented by an inset axes.
|
|
480
|
+
|
|
481
|
+
This function draws a box in *parent_axes* at the bounding box of
|
|
482
|
+
*inset_axes*, and shows a connection with the inset axes by drawing lines
|
|
483
|
+
at the corners, giving a "zoomed in" effect.
|
|
484
|
+
|
|
485
|
+
Parameters
|
|
486
|
+
----------
|
|
487
|
+
parent_axes : `~matplotlib.axes.Axes`
|
|
488
|
+
Axes which contains the area of the inset axes.
|
|
489
|
+
|
|
490
|
+
inset_axes : `~matplotlib.axes.Axes`
|
|
491
|
+
The inset axes.
|
|
492
|
+
|
|
493
|
+
loc1, loc2 : {1, 2, 3, 4}
|
|
494
|
+
Corners to use for connecting the inset axes and the area in the
|
|
495
|
+
parent axes.
|
|
496
|
+
|
|
497
|
+
**kwargs
|
|
498
|
+
Patch properties for the lines and box drawn:
|
|
499
|
+
|
|
500
|
+
%(Patch:kwdoc)s
|
|
501
|
+
|
|
502
|
+
Returns
|
|
503
|
+
-------
|
|
504
|
+
pp : `~matplotlib.patches.Patch`
|
|
505
|
+
The patch drawn to represent the area of the inset axes.
|
|
506
|
+
|
|
507
|
+
p1, p2 : `~matplotlib.patches.Patch`
|
|
508
|
+
The patches connecting two corners of the inset axes and its area.
|
|
509
|
+
"""
|
|
510
|
+
rect = _TransformedBboxWithCallback(
|
|
511
|
+
inset_axes.viewLim, parent_axes.transData,
|
|
512
|
+
callback=parent_axes._unstale_viewLim)
|
|
513
|
+
|
|
514
|
+
kwargs.setdefault("fill", bool({'fc', 'facecolor', 'color'}.intersection(kwargs)))
|
|
515
|
+
pp = BboxPatch(rect, **kwargs)
|
|
516
|
+
parent_axes.add_patch(pp)
|
|
517
|
+
|
|
518
|
+
p1 = BboxConnector(inset_axes.bbox, rect, loc1=loc1, **kwargs)
|
|
519
|
+
inset_axes.add_patch(p1)
|
|
520
|
+
p1.set_clip_on(False)
|
|
521
|
+
p2 = BboxConnector(inset_axes.bbox, rect, loc1=loc2, **kwargs)
|
|
522
|
+
inset_axes.add_patch(p2)
|
|
523
|
+
p2.set_clip_on(False)
|
|
524
|
+
|
|
525
|
+
return pp, p1, p2
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
import matplotlib_rs.axes as maxes
|
|
3
|
+
from matplotlib_rs.artist import Artist
|
|
4
|
+
from matplotlib_rs.axis import XAxis, YAxis
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SimpleChainedObjects:
|
|
8
|
+
def __init__(self, objects):
|
|
9
|
+
self._objects = objects
|
|
10
|
+
|
|
11
|
+
def __getattr__(self, k):
|
|
12
|
+
_a = SimpleChainedObjects([getattr(a, k) for a in self._objects])
|
|
13
|
+
return _a
|
|
14
|
+
|
|
15
|
+
def __call__(self, *args, **kwargs):
|
|
16
|
+
for m in self._objects:
|
|
17
|
+
m(*args, **kwargs)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Axes(maxes.Axes):
|
|
21
|
+
|
|
22
|
+
class AxisDict(dict):
|
|
23
|
+
def __init__(self, axes):
|
|
24
|
+
self.axes = axes
|
|
25
|
+
super().__init__()
|
|
26
|
+
|
|
27
|
+
def __getitem__(self, k):
|
|
28
|
+
if isinstance(k, tuple):
|
|
29
|
+
r = SimpleChainedObjects(
|
|
30
|
+
# super() within a list comprehension needs explicit args.
|
|
31
|
+
[super(Axes.AxisDict, self).__getitem__(k1) for k1 in k])
|
|
32
|
+
return r
|
|
33
|
+
elif isinstance(k, slice):
|
|
34
|
+
if k.start is None and k.stop is None and k.step is None:
|
|
35
|
+
return SimpleChainedObjects(list(self.values()))
|
|
36
|
+
else:
|
|
37
|
+
raise ValueError("Unsupported slice")
|
|
38
|
+
else:
|
|
39
|
+
return dict.__getitem__(self, k)
|
|
40
|
+
|
|
41
|
+
def __call__(self, *v, **kwargs):
|
|
42
|
+
return maxes.Axes.axis(self.axes, *v, **kwargs)
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def axis(self):
|
|
46
|
+
return self._axislines
|
|
47
|
+
|
|
48
|
+
def clear(self):
|
|
49
|
+
# docstring inherited
|
|
50
|
+
super().clear()
|
|
51
|
+
# Init axis artists.
|
|
52
|
+
self._axislines = self.AxisDict(self)
|
|
53
|
+
self._axislines.update(
|
|
54
|
+
bottom=SimpleAxisArtist(self.xaxis, 1, self.spines["bottom"]),
|
|
55
|
+
top=SimpleAxisArtist(self.xaxis, 2, self.spines["top"]),
|
|
56
|
+
left=SimpleAxisArtist(self.yaxis, 1, self.spines["left"]),
|
|
57
|
+
right=SimpleAxisArtist(self.yaxis, 2, self.spines["right"]))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class SimpleAxisArtist(Artist):
|
|
61
|
+
def __init__(self, axis, axisnum, spine):
|
|
62
|
+
self._axis = axis
|
|
63
|
+
self._axisnum = axisnum
|
|
64
|
+
self.line = spine
|
|
65
|
+
|
|
66
|
+
if isinstance(axis, XAxis):
|
|
67
|
+
self._axis_direction = ["bottom", "top"][axisnum-1]
|
|
68
|
+
elif isinstance(axis, YAxis):
|
|
69
|
+
self._axis_direction = ["left", "right"][axisnum-1]
|
|
70
|
+
else:
|
|
71
|
+
raise ValueError(
|
|
72
|
+
f"axis must be instance of XAxis or YAxis, but got {axis}")
|
|
73
|
+
super().__init__()
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def major_ticks(self):
|
|
77
|
+
tickline = "tick%dline" % self._axisnum
|
|
78
|
+
return SimpleChainedObjects([getattr(tick, tickline)
|
|
79
|
+
for tick in self._axis.get_major_ticks()])
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def major_ticklabels(self):
|
|
83
|
+
label = "label%d" % self._axisnum
|
|
84
|
+
return SimpleChainedObjects([getattr(tick, label)
|
|
85
|
+
for tick in self._axis.get_major_ticks()])
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def label(self):
|
|
89
|
+
return self._axis.label
|
|
90
|
+
|
|
91
|
+
def set_visible(self, b):
|
|
92
|
+
self.toggle(all=b)
|
|
93
|
+
self.line.set_visible(b)
|
|
94
|
+
self._axis.set_visible(True)
|
|
95
|
+
super().set_visible(b)
|
|
96
|
+
|
|
97
|
+
def set_label(self, txt):
|
|
98
|
+
self._axis.set_label_text(txt)
|
|
99
|
+
|
|
100
|
+
def toggle(self, all=None, ticks=None, ticklabels=None, label=None):
|
|
101
|
+
|
|
102
|
+
if all:
|
|
103
|
+
_ticks, _ticklabels, _label = True, True, True
|
|
104
|
+
elif all is not None:
|
|
105
|
+
_ticks, _ticklabels, _label = False, False, False
|
|
106
|
+
else:
|
|
107
|
+
_ticks, _ticklabels, _label = None, None, None
|
|
108
|
+
|
|
109
|
+
if ticks is not None:
|
|
110
|
+
_ticks = ticks
|
|
111
|
+
if ticklabels is not None:
|
|
112
|
+
_ticklabels = ticklabels
|
|
113
|
+
if label is not None:
|
|
114
|
+
_label = label
|
|
115
|
+
|
|
116
|
+
if _ticks is not None:
|
|
117
|
+
tickparam = {f"tick{self._axisnum}On": _ticks}
|
|
118
|
+
self._axis.set_tick_params(**tickparam)
|
|
119
|
+
if _ticklabels is not None:
|
|
120
|
+
tickparam = {f"label{self._axisnum}On": _ticklabels}
|
|
121
|
+
self._axis.set_tick_params(**tickparam)
|
|
122
|
+
|
|
123
|
+
if _label is not None:
|
|
124
|
+
pos = self._axis.get_label_position()
|
|
125
|
+
if (pos == self._axis_direction) and not _label:
|
|
126
|
+
self._axis.label.set_visible(False)
|
|
127
|
+
elif _label:
|
|
128
|
+
self._axis.label.set_visible(True)
|
|
129
|
+
self._axis.set_label_position(self._axis_direction)
|