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,265 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
An experimental support for curvilinear grid.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# TODO :
|
|
7
|
+
# see if tick_iterator method can be simplified by reusing the parent method.
|
|
8
|
+
|
|
9
|
+
import functools
|
|
10
|
+
|
|
11
|
+
import numpy as np
|
|
12
|
+
|
|
13
|
+
import matplotlib_rs as mpl
|
|
14
|
+
from matplotlib_rs import _api, cbook
|
|
15
|
+
import matplotlib_rs.patches as mpatches
|
|
16
|
+
from matplotlib_rs.path import Path
|
|
17
|
+
from matplotlib_rs.transforms import Bbox
|
|
18
|
+
from matplotlib_rs.mpl_toolkits.axes_grid1.parasite_axes import host_axes_class_factory
|
|
19
|
+
from . import axislines, grid_helper_curvelinear
|
|
20
|
+
from .axis_artist import AxisArtist
|
|
21
|
+
from .grid_finder import ExtremeFinderSimple
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class FloatingAxisArtistHelper(
|
|
25
|
+
grid_helper_curvelinear.FloatingAxisArtistHelper):
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class FixedAxisArtistHelper(grid_helper_curvelinear.FloatingAxisArtistHelper):
|
|
30
|
+
|
|
31
|
+
def __init__(self, grid_helper, side, nth_coord_ticks=None):
|
|
32
|
+
"""
|
|
33
|
+
nth_coord = along which coordinate value varies.
|
|
34
|
+
nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
|
|
35
|
+
"""
|
|
36
|
+
lon1, lon2, lat1, lat2 = grid_helper.grid_finder.extreme_finder(*[None] * 5)
|
|
37
|
+
value, nth_coord = _api.getitem_checked(
|
|
38
|
+
dict(left=(lon1, 0), right=(lon2, 0), bottom=(lat1, 1), top=(lat2, 1)),
|
|
39
|
+
side=side)
|
|
40
|
+
super().__init__(grid_helper, nth_coord, value, axis_direction=side)
|
|
41
|
+
if nth_coord_ticks is None:
|
|
42
|
+
nth_coord_ticks = nth_coord
|
|
43
|
+
self.nth_coord_ticks = nth_coord_ticks
|
|
44
|
+
|
|
45
|
+
self.value = value
|
|
46
|
+
self.grid_helper = grid_helper
|
|
47
|
+
self._side = side
|
|
48
|
+
|
|
49
|
+
def update_lim(self, axes):
|
|
50
|
+
self.grid_helper.update_lim(axes)
|
|
51
|
+
self._grid_info = self.grid_helper._grid_info
|
|
52
|
+
|
|
53
|
+
def get_tick_iterators(self, axes):
|
|
54
|
+
"""tick_loc, tick_angle, tick_label, (optionally) tick_label"""
|
|
55
|
+
|
|
56
|
+
grid_finder = self.grid_helper.grid_finder
|
|
57
|
+
|
|
58
|
+
lat_levs, lat_n, lat_factor = self._grid_info["lat_info"]
|
|
59
|
+
yy0 = lat_levs / lat_factor
|
|
60
|
+
|
|
61
|
+
lon_levs, lon_n, lon_factor = self._grid_info["lon_info"]
|
|
62
|
+
xx0 = lon_levs / lon_factor
|
|
63
|
+
|
|
64
|
+
extremes = self.grid_helper.grid_finder.extreme_finder(*[None] * 5)
|
|
65
|
+
xmin, xmax = sorted(extremes[:2])
|
|
66
|
+
ymin, ymax = sorted(extremes[2:])
|
|
67
|
+
|
|
68
|
+
def trf_xy(x, y):
|
|
69
|
+
trf = grid_finder.get_transform() + axes.transData
|
|
70
|
+
return trf.transform(np.column_stack(np.broadcast_arrays(x, y))).T
|
|
71
|
+
|
|
72
|
+
if self.nth_coord == 0:
|
|
73
|
+
mask = (ymin <= yy0) & (yy0 <= ymax)
|
|
74
|
+
(xx1, yy1), angle_normal, angle_tangent = \
|
|
75
|
+
grid_helper_curvelinear._value_and_jac_angle(
|
|
76
|
+
trf_xy, self.value, yy0[mask], (xmin, xmax), (ymin, ymax))
|
|
77
|
+
labels = self._grid_info["lat_labels"]
|
|
78
|
+
|
|
79
|
+
elif self.nth_coord == 1:
|
|
80
|
+
mask = (xmin <= xx0) & (xx0 <= xmax)
|
|
81
|
+
(xx1, yy1), angle_tangent, angle_normal = \
|
|
82
|
+
grid_helper_curvelinear._value_and_jac_angle(
|
|
83
|
+
trf_xy, xx0[mask], self.value, (xmin, xmax), (ymin, ymax))
|
|
84
|
+
labels = self._grid_info["lon_labels"]
|
|
85
|
+
|
|
86
|
+
labels = [l for l, m in zip(labels, mask) if m]
|
|
87
|
+
tick_to_axes = self.get_tick_transform(axes) - axes.transAxes
|
|
88
|
+
in_01 = functools.partial(
|
|
89
|
+
mpl.transforms._interval_contains_close, (0, 1))
|
|
90
|
+
|
|
91
|
+
def f1():
|
|
92
|
+
for x, y, normal, tangent, lab \
|
|
93
|
+
in zip(xx1, yy1, angle_normal, angle_tangent, labels):
|
|
94
|
+
c2 = tick_to_axes.transform((x, y))
|
|
95
|
+
if in_01(c2[0]) and in_01(c2[1]):
|
|
96
|
+
yield [x, y], *np.rad2deg([normal, tangent]), lab
|
|
97
|
+
|
|
98
|
+
return f1(), iter([])
|
|
99
|
+
|
|
100
|
+
def get_line(self, axes):
|
|
101
|
+
self.update_lim(axes)
|
|
102
|
+
k, v = dict(left=("lon_lines0", 0),
|
|
103
|
+
right=("lon_lines0", 1),
|
|
104
|
+
bottom=("lat_lines0", 0),
|
|
105
|
+
top=("lat_lines0", 1))[self._side]
|
|
106
|
+
return Path(self._grid_info[k][v])
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class ExtremeFinderFixed(ExtremeFinderSimple):
|
|
110
|
+
# docstring inherited
|
|
111
|
+
|
|
112
|
+
def __init__(self, extremes):
|
|
113
|
+
"""
|
|
114
|
+
This subclass always returns the same bounding box.
|
|
115
|
+
|
|
116
|
+
Parameters
|
|
117
|
+
----------
|
|
118
|
+
extremes : (float, float, float, float)
|
|
119
|
+
The bounding box that this helper always returns.
|
|
120
|
+
"""
|
|
121
|
+
x0, x1, y0, y1 = extremes
|
|
122
|
+
self._tbbox = Bbox.from_extents(x0, y0, x1, y1)
|
|
123
|
+
|
|
124
|
+
def _find_transformed_bbox(self, trans, bbox):
|
|
125
|
+
# docstring inherited
|
|
126
|
+
return self._tbbox
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class GridHelperCurveLinear(grid_helper_curvelinear.GridHelperCurveLinear):
|
|
130
|
+
|
|
131
|
+
def __init__(self, aux_trans, extremes,
|
|
132
|
+
grid_locator1=None,
|
|
133
|
+
grid_locator2=None,
|
|
134
|
+
tick_formatter1=None,
|
|
135
|
+
tick_formatter2=None):
|
|
136
|
+
# docstring inherited
|
|
137
|
+
super().__init__(aux_trans,
|
|
138
|
+
extreme_finder=ExtremeFinderFixed(extremes),
|
|
139
|
+
grid_locator1=grid_locator1,
|
|
140
|
+
grid_locator2=grid_locator2,
|
|
141
|
+
tick_formatter1=tick_formatter1,
|
|
142
|
+
tick_formatter2=tick_formatter2)
|
|
143
|
+
|
|
144
|
+
def new_fixed_axis(
|
|
145
|
+
self, loc, nth_coord=None, axis_direction=None, offset=None, axes=None):
|
|
146
|
+
if axes is None:
|
|
147
|
+
axes = self.axes
|
|
148
|
+
if axis_direction is None:
|
|
149
|
+
axis_direction = loc
|
|
150
|
+
# This is not the same as the FixedAxisArtistHelper class used by
|
|
151
|
+
# grid_helper_curvelinear.GridHelperCurveLinear.new_fixed_axis!
|
|
152
|
+
helper = FixedAxisArtistHelper(
|
|
153
|
+
self, loc, nth_coord_ticks=nth_coord)
|
|
154
|
+
axisline = AxisArtist(axes, helper, axis_direction=axis_direction)
|
|
155
|
+
# Perhaps should be moved to the base class?
|
|
156
|
+
axisline.line.set_clip_on(True)
|
|
157
|
+
axisline.line.set_clip_box(axisline.axes.bbox)
|
|
158
|
+
return axisline
|
|
159
|
+
|
|
160
|
+
# new_floating_axis will inherit the grid_helper's extremes.
|
|
161
|
+
|
|
162
|
+
# def new_floating_axis(self, nth_coord, value, axes=None, axis_direction="bottom"):
|
|
163
|
+
# axis = super(GridHelperCurveLinear,
|
|
164
|
+
# self).new_floating_axis(nth_coord,
|
|
165
|
+
# value, axes=axes,
|
|
166
|
+
# axis_direction=axis_direction)
|
|
167
|
+
# # set extreme values of the axis helper
|
|
168
|
+
# if nth_coord == 1:
|
|
169
|
+
# axis.get_helper().set_extremes(*self._extremes[:2])
|
|
170
|
+
# elif nth_coord == 0:
|
|
171
|
+
# axis.get_helper().set_extremes(*self._extremes[2:])
|
|
172
|
+
# return axis
|
|
173
|
+
|
|
174
|
+
def _update_grid(self, bbox):
|
|
175
|
+
if self._grid_info is None:
|
|
176
|
+
self._grid_info = dict()
|
|
177
|
+
|
|
178
|
+
grid_info = self._grid_info
|
|
179
|
+
|
|
180
|
+
grid_finder = self.grid_finder
|
|
181
|
+
tbbox = grid_finder.extreme_finder._find_transformed_bbox(
|
|
182
|
+
grid_finder.get_transform().inverted(), bbox)
|
|
183
|
+
|
|
184
|
+
lon_min, lat_min, lon_max, lat_max = tbbox.extents
|
|
185
|
+
grid_info["extremes"] = tbbox
|
|
186
|
+
|
|
187
|
+
lon_levs, lon_n, lon_factor = grid_finder.grid_locator1(lon_min, lon_max)
|
|
188
|
+
lon_levs = np.asarray(lon_levs)
|
|
189
|
+
lat_levs, lat_n, lat_factor = grid_finder.grid_locator2(lat_min, lat_max)
|
|
190
|
+
lat_levs = np.asarray(lat_levs)
|
|
191
|
+
|
|
192
|
+
grid_info["lon_info"] = lon_levs, lon_n, lon_factor
|
|
193
|
+
grid_info["lat_info"] = lat_levs, lat_n, lat_factor
|
|
194
|
+
|
|
195
|
+
grid_info["lon_labels"] = grid_finder._format_ticks(
|
|
196
|
+
1, "bottom", lon_factor, lon_levs)
|
|
197
|
+
grid_info["lat_labels"] = grid_finder._format_ticks(
|
|
198
|
+
2, "bottom", lat_factor, lat_levs)
|
|
199
|
+
|
|
200
|
+
lon_values = lon_levs[:lon_n] / lon_factor
|
|
201
|
+
lat_values = lat_levs[:lat_n] / lat_factor
|
|
202
|
+
|
|
203
|
+
lon_lines, lat_lines = grid_finder._get_raw_grid_lines(
|
|
204
|
+
lon_values[(lon_min < lon_values) & (lon_values < lon_max)],
|
|
205
|
+
lat_values[(lat_min < lat_values) & (lat_values < lat_max)],
|
|
206
|
+
tbbox)
|
|
207
|
+
|
|
208
|
+
grid_info["lon_lines"] = lon_lines
|
|
209
|
+
grid_info["lat_lines"] = lat_lines
|
|
210
|
+
|
|
211
|
+
lon_lines, lat_lines = grid_finder._get_raw_grid_lines(
|
|
212
|
+
tbbox.intervalx, tbbox.intervaly, tbbox)
|
|
213
|
+
|
|
214
|
+
grid_info["lon_lines0"] = lon_lines
|
|
215
|
+
grid_info["lat_lines0"] = lat_lines
|
|
216
|
+
|
|
217
|
+
def get_gridlines(self, which="major", axis="both"):
|
|
218
|
+
grid_lines = []
|
|
219
|
+
if axis in ["both", "x"]:
|
|
220
|
+
grid_lines.extend(map(np.transpose, self._grid_info["lon_lines"]))
|
|
221
|
+
if axis in ["both", "y"]:
|
|
222
|
+
grid_lines.extend(map(np.transpose, self._grid_info["lat_lines"]))
|
|
223
|
+
return grid_lines
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class FloatingAxesBase:
|
|
227
|
+
|
|
228
|
+
def __init__(self, *args, grid_helper, **kwargs):
|
|
229
|
+
_api.check_isinstance(GridHelperCurveLinear, grid_helper=grid_helper)
|
|
230
|
+
super().__init__(*args, grid_helper=grid_helper, **kwargs)
|
|
231
|
+
self.set_aspect(1.)
|
|
232
|
+
|
|
233
|
+
def _gen_axes_patch(self):
|
|
234
|
+
# docstring inherited
|
|
235
|
+
x0, x1, y0, y1 = self.get_grid_helper().grid_finder.extreme_finder(*[None] * 5)
|
|
236
|
+
patch = mpatches.Polygon([(x0, y0), (x1, y0), (x1, y1), (x0, y1)])
|
|
237
|
+
patch.get_path()._interpolation_steps = 100
|
|
238
|
+
return patch
|
|
239
|
+
|
|
240
|
+
def clear(self):
|
|
241
|
+
super().clear()
|
|
242
|
+
self.patch.set_transform(
|
|
243
|
+
self.get_grid_helper().grid_finder.get_transform()
|
|
244
|
+
+ self.transData)
|
|
245
|
+
# The original patch is not in the draw tree; it is only used for
|
|
246
|
+
# clipping purposes.
|
|
247
|
+
orig_patch = super()._gen_axes_patch()
|
|
248
|
+
orig_patch.set_figure(self.get_figure(root=False))
|
|
249
|
+
orig_patch.set_transform(self.transAxes)
|
|
250
|
+
self.patch.set_clip_path(orig_patch)
|
|
251
|
+
self.gridlines.set_clip_path(orig_patch)
|
|
252
|
+
self.adjust_axes_lim()
|
|
253
|
+
|
|
254
|
+
def adjust_axes_lim(self):
|
|
255
|
+
bbox = self.patch.get_path().get_extents(
|
|
256
|
+
# First transform to pixel coords, then to parent data coords.
|
|
257
|
+
self.patch.get_transform() - self.transData)
|
|
258
|
+
bbox = bbox.expanded(1.02, 1.02)
|
|
259
|
+
self.set_xlim(bbox.xmin, bbox.xmax)
|
|
260
|
+
self.set_ylim(bbox.ymin, bbox.ymax)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
floatingaxes_class_factory = cbook._make_class_factory(FloatingAxesBase, "Floating{}")
|
|
264
|
+
FloatingAxes = floatingaxes_class_factory(host_axes_class_factory(axislines.Axes))
|
|
265
|
+
FloatingSubplot = FloatingAxes
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
import numpy as np
|
|
3
|
+
|
|
4
|
+
from matplotlib_rs import ticker as mticker, _api
|
|
5
|
+
from matplotlib_rs.transforms import Bbox, Transform
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _find_line_box_crossings(xys, bbox):
|
|
9
|
+
"""
|
|
10
|
+
Find the points where a polyline crosses a bbox, and the crossing angles.
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
----------
|
|
14
|
+
xys : (N, 2) array
|
|
15
|
+
The polyline coordinates.
|
|
16
|
+
bbox : `.Bbox`
|
|
17
|
+
The bounding box.
|
|
18
|
+
|
|
19
|
+
Returns
|
|
20
|
+
-------
|
|
21
|
+
list of ((float, float), float)
|
|
22
|
+
Four separate lists of crossings, for the left, right, bottom, and top
|
|
23
|
+
sides of the bbox, respectively. For each list, the entries are the
|
|
24
|
+
``((x, y), ccw_angle_in_degrees)`` of the crossing, where an angle of 0
|
|
25
|
+
means that the polyline is moving to the right at the crossing point.
|
|
26
|
+
|
|
27
|
+
The entries are computed by linearly interpolating at each crossing
|
|
28
|
+
between the nearest points on either side of the bbox edges.
|
|
29
|
+
"""
|
|
30
|
+
crossings = []
|
|
31
|
+
dxys = xys[1:] - xys[:-1]
|
|
32
|
+
for sl in [slice(None), slice(None, None, -1)]:
|
|
33
|
+
us, vs = xys.T[sl] # "this" coord, "other" coord
|
|
34
|
+
dus, dvs = dxys.T[sl]
|
|
35
|
+
umin, vmin = bbox.min[sl]
|
|
36
|
+
umax, vmax = bbox.max[sl]
|
|
37
|
+
for u0, inside in [(umin, us > umin), (umax, us < umax)]:
|
|
38
|
+
cross = []
|
|
39
|
+
idxs, = (inside[:-1] ^ inside[1:]).nonzero()
|
|
40
|
+
vv = vs[idxs] + (u0 - us[idxs]) * dvs[idxs] / dus[idxs]
|
|
41
|
+
crossings.append([
|
|
42
|
+
((u0, v)[sl], np.degrees(np.arctan2(*dxy[::-1]))) # ((x, y), theta)
|
|
43
|
+
for v, dxy in zip(vv, dxys[idxs]) if vmin <= v <= vmax])
|
|
44
|
+
return crossings
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ExtremeFinderSimple:
|
|
48
|
+
"""
|
|
49
|
+
A helper class to figure out the range of grid lines that need to be drawn.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __init__(self, nx, ny):
|
|
53
|
+
"""
|
|
54
|
+
Parameters
|
|
55
|
+
----------
|
|
56
|
+
nx, ny : int
|
|
57
|
+
The number of samples in each direction.
|
|
58
|
+
"""
|
|
59
|
+
self.nx = nx
|
|
60
|
+
self.ny = ny
|
|
61
|
+
|
|
62
|
+
def __call__(self, transform_xy, x1, y1, x2, y2):
|
|
63
|
+
"""
|
|
64
|
+
Compute an approximation of the bounding box obtained by applying
|
|
65
|
+
*transform_xy* to the box delimited by ``(x1, y1, x2, y2)``.
|
|
66
|
+
|
|
67
|
+
The intended use is to have ``(x1, y1, x2, y2)`` in axes coordinates,
|
|
68
|
+
and have *transform_xy* be the transform from axes coordinates to data
|
|
69
|
+
coordinates; this method then returns the range of data coordinates
|
|
70
|
+
that span the actual axes.
|
|
71
|
+
|
|
72
|
+
The computation is done by sampling ``nx * ny`` equispaced points in
|
|
73
|
+
the ``(x1, y1, x2, y2)`` box and finding the resulting points with
|
|
74
|
+
extremal coordinates; then adding some padding to take into account the
|
|
75
|
+
finite sampling.
|
|
76
|
+
|
|
77
|
+
As each sampling step covers a relative range of ``1/nx`` or ``1/ny``,
|
|
78
|
+
the padding is computed by expanding the span covered by the extremal
|
|
79
|
+
coordinates by these fractions.
|
|
80
|
+
"""
|
|
81
|
+
tbbox = self._find_transformed_bbox(
|
|
82
|
+
_User2DTransform(transform_xy, None), Bbox.from_extents(x1, y1, x2, y2))
|
|
83
|
+
return tbbox.x0, tbbox.x1, tbbox.y0, tbbox.y1
|
|
84
|
+
|
|
85
|
+
def _find_transformed_bbox(self, trans, bbox):
|
|
86
|
+
"""
|
|
87
|
+
Compute an approximation of the bounding box obtained by applying
|
|
88
|
+
*trans* to *bbox*.
|
|
89
|
+
|
|
90
|
+
See ``__call__`` for details; this method performs similar
|
|
91
|
+
calculations, but using a different representation of the arguments and
|
|
92
|
+
return value.
|
|
93
|
+
"""
|
|
94
|
+
grid = np.reshape(np.meshgrid(np.linspace(bbox.x0, bbox.x1, self.nx),
|
|
95
|
+
np.linspace(bbox.y0, bbox.y1, self.ny)),
|
|
96
|
+
(2, -1)).T
|
|
97
|
+
tbbox = Bbox.null()
|
|
98
|
+
tbbox.update_from_data_xy(trans.transform(grid))
|
|
99
|
+
return tbbox.expanded(1 + 2 / self.nx, 1 + 2 / self.ny)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class _User2DTransform(Transform):
|
|
103
|
+
"""A transform defined by two user-set functions."""
|
|
104
|
+
|
|
105
|
+
input_dims = output_dims = 2
|
|
106
|
+
|
|
107
|
+
def __init__(self, forward, backward):
|
|
108
|
+
"""
|
|
109
|
+
Parameters
|
|
110
|
+
----------
|
|
111
|
+
forward, backward : callable
|
|
112
|
+
The forward and backward transforms, taking ``x`` and ``y`` as
|
|
113
|
+
separate arguments and returning ``(tr_x, tr_y)``.
|
|
114
|
+
"""
|
|
115
|
+
# The normal Matplotlib convention would be to take and return an
|
|
116
|
+
# (N, 2) array but axisartist uses the transposed version.
|
|
117
|
+
super().__init__()
|
|
118
|
+
self._forward = forward
|
|
119
|
+
self._backward = backward
|
|
120
|
+
|
|
121
|
+
def transform_non_affine(self, values):
|
|
122
|
+
# docstring inherited
|
|
123
|
+
return np.transpose(self._forward(*np.transpose(values)))
|
|
124
|
+
|
|
125
|
+
def inverted(self):
|
|
126
|
+
# docstring inherited
|
|
127
|
+
return type(self)(self._backward, self._forward)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class GridFinder:
|
|
131
|
+
"""
|
|
132
|
+
Internal helper for `~.grid_helper_curvelinear.GridHelperCurveLinear`, with
|
|
133
|
+
the same constructor parameters; should not be directly instantiated.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
def __init__(self,
|
|
137
|
+
transform,
|
|
138
|
+
extreme_finder=None,
|
|
139
|
+
grid_locator1=None,
|
|
140
|
+
grid_locator2=None,
|
|
141
|
+
tick_formatter1=None,
|
|
142
|
+
tick_formatter2=None):
|
|
143
|
+
if extreme_finder is None:
|
|
144
|
+
extreme_finder = ExtremeFinderSimple(20, 20)
|
|
145
|
+
if grid_locator1 is None:
|
|
146
|
+
grid_locator1 = MaxNLocator()
|
|
147
|
+
if grid_locator2 is None:
|
|
148
|
+
grid_locator2 = MaxNLocator()
|
|
149
|
+
if tick_formatter1 is None:
|
|
150
|
+
tick_formatter1 = FormatterPrettyPrint()
|
|
151
|
+
if tick_formatter2 is None:
|
|
152
|
+
tick_formatter2 = FormatterPrettyPrint()
|
|
153
|
+
self.extreme_finder = extreme_finder
|
|
154
|
+
self.grid_locator1 = grid_locator1
|
|
155
|
+
self.grid_locator2 = grid_locator2
|
|
156
|
+
self.tick_formatter1 = tick_formatter1
|
|
157
|
+
self.tick_formatter2 = tick_formatter2
|
|
158
|
+
self.set_transform(transform)
|
|
159
|
+
|
|
160
|
+
def _format_ticks(self, idx, direction, factor, levels):
|
|
161
|
+
"""
|
|
162
|
+
Helper to support both standard formatters (inheriting from
|
|
163
|
+
`.mticker.Formatter`) and axisartist-specific ones; should be called instead of
|
|
164
|
+
directly calling ``self.tick_formatter1`` and ``self.tick_formatter2``. This
|
|
165
|
+
method should be considered as a temporary workaround which will be removed in
|
|
166
|
+
the future at the same time as axisartist-specific formatters.
|
|
167
|
+
"""
|
|
168
|
+
fmt = _api.getitem_checked(
|
|
169
|
+
{1: self.tick_formatter1, 2: self.tick_formatter2}, idx=idx)
|
|
170
|
+
return (fmt.format_ticks(levels) if isinstance(fmt, mticker.Formatter)
|
|
171
|
+
else fmt(direction, factor, levels))
|
|
172
|
+
|
|
173
|
+
def get_grid_info(self, *args, **kwargs):
|
|
174
|
+
"""
|
|
175
|
+
Compute positioning information for grid lines and ticks, given the
|
|
176
|
+
axes' data *bbox*.
|
|
177
|
+
"""
|
|
178
|
+
params = _api.select_matching_signature(
|
|
179
|
+
[lambda x1, y1, x2, y2: locals(), lambda bbox: locals()], *args, **kwargs)
|
|
180
|
+
if "x1" in params:
|
|
181
|
+
_api.warn_deprecated("3.11", message=(
|
|
182
|
+
"Passing extents as separate arguments to get_grid_info is deprecated "
|
|
183
|
+
"since %(since)s and support will be removed %(removal)s; pass a "
|
|
184
|
+
"single bbox instead."))
|
|
185
|
+
bbox = Bbox.from_extents(
|
|
186
|
+
params["x1"], params["y1"], params["x2"], params["y2"])
|
|
187
|
+
else:
|
|
188
|
+
bbox = params["bbox"]
|
|
189
|
+
|
|
190
|
+
tbbox = self.extreme_finder._find_transformed_bbox(
|
|
191
|
+
self.get_transform().inverted(), bbox)
|
|
192
|
+
|
|
193
|
+
lon_levs, lon_n, lon_factor = self.grid_locator1(*tbbox.intervalx)
|
|
194
|
+
lat_levs, lat_n, lat_factor = self.grid_locator2(*tbbox.intervaly)
|
|
195
|
+
|
|
196
|
+
lon_values = np.asarray(lon_levs[:lon_n]) / lon_factor
|
|
197
|
+
lat_values = np.asarray(lat_levs[:lat_n]) / lat_factor
|
|
198
|
+
|
|
199
|
+
lon_lines, lat_lines = self._get_raw_grid_lines(lon_values, lat_values, tbbox)
|
|
200
|
+
|
|
201
|
+
bbox_expanded = bbox.expanded(1 + 2e-10, 1 + 2e-10)
|
|
202
|
+
grid_info = {"extremes": tbbox} # "lon", "lat" keys filled below.
|
|
203
|
+
|
|
204
|
+
for idx, lon_or_lat, levs, factor, values, lines in [
|
|
205
|
+
(1, "lon", lon_levs, lon_factor, lon_values, lon_lines),
|
|
206
|
+
(2, "lat", lat_levs, lat_factor, lat_values, lat_lines),
|
|
207
|
+
]:
|
|
208
|
+
grid_info[lon_or_lat] = gi = {
|
|
209
|
+
"lines": lines,
|
|
210
|
+
"ticks": {"left": [], "right": [], "bottom": [], "top": []},
|
|
211
|
+
}
|
|
212
|
+
for xys, v, level in zip(lines, values, levs):
|
|
213
|
+
all_crossings = _find_line_box_crossings(xys, bbox_expanded)
|
|
214
|
+
for side, crossings in zip(
|
|
215
|
+
["left", "right", "bottom", "top"], all_crossings):
|
|
216
|
+
for crossing in crossings:
|
|
217
|
+
gi["ticks"][side].append({"level": level, "loc": crossing})
|
|
218
|
+
for side in gi["ticks"]:
|
|
219
|
+
levs = [tick["level"] for tick in gi["ticks"][side]]
|
|
220
|
+
labels = self._format_ticks(idx, side, factor, levs)
|
|
221
|
+
for tick, label in zip(gi["ticks"][side], labels):
|
|
222
|
+
tick["label"] = label
|
|
223
|
+
|
|
224
|
+
return grid_info
|
|
225
|
+
|
|
226
|
+
def _get_raw_grid_lines(self, lon_values, lat_values, bbox):
|
|
227
|
+
trans = self.get_transform()
|
|
228
|
+
lons = np.linspace(bbox.x0, bbox.x1, 100) # for interpolation
|
|
229
|
+
lats = np.linspace(bbox.y0, bbox.y1, 100)
|
|
230
|
+
lon_lines = [trans.transform(np.column_stack([np.full_like(lats, lon), lats]))
|
|
231
|
+
for lon in lon_values]
|
|
232
|
+
lat_lines = [trans.transform(np.column_stack([lons, np.full_like(lons, lat)]))
|
|
233
|
+
for lat in lat_values]
|
|
234
|
+
return lon_lines, lat_lines
|
|
235
|
+
|
|
236
|
+
def set_transform(self, aux_trans):
|
|
237
|
+
if isinstance(aux_trans, Transform):
|
|
238
|
+
self._aux_transform = aux_trans
|
|
239
|
+
elif len(aux_trans) == 2 and all(map(callable, aux_trans)):
|
|
240
|
+
self._aux_transform = _User2DTransform(*aux_trans)
|
|
241
|
+
else:
|
|
242
|
+
raise TypeError("'aux_trans' must be either a Transform "
|
|
243
|
+
"instance or a pair of callables")
|
|
244
|
+
|
|
245
|
+
def get_transform(self):
|
|
246
|
+
return self._aux_transform
|
|
247
|
+
|
|
248
|
+
update_transform = set_transform # backcompat alias.
|
|
249
|
+
|
|
250
|
+
@_api.deprecated("3.11", alternative="grid_finder.get_transform()")
|
|
251
|
+
def transform_xy(self, x, y):
|
|
252
|
+
return self._aux_transform.transform(np.column_stack([x, y])).T
|
|
253
|
+
|
|
254
|
+
@_api.deprecated("3.11", alternative="grid_finder.get_transform().inverted()")
|
|
255
|
+
def inv_transform_xy(self, x, y):
|
|
256
|
+
return self._aux_transform.inverted().transform(
|
|
257
|
+
np.column_stack([x, y])).T
|
|
258
|
+
|
|
259
|
+
def update(self, **kwargs):
|
|
260
|
+
for k, v in kwargs.items():
|
|
261
|
+
if k in ["extreme_finder",
|
|
262
|
+
"grid_locator1",
|
|
263
|
+
"grid_locator2",
|
|
264
|
+
"tick_formatter1",
|
|
265
|
+
"tick_formatter2"]:
|
|
266
|
+
setattr(self, k, v)
|
|
267
|
+
else:
|
|
268
|
+
raise ValueError(f"Unknown update property {k!r}")
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
class MaxNLocator(mticker.MaxNLocator):
|
|
272
|
+
def __init__(self, nbins=10, steps=None,
|
|
273
|
+
trim=True,
|
|
274
|
+
integer=False,
|
|
275
|
+
symmetric=False,
|
|
276
|
+
prune=None):
|
|
277
|
+
# trim argument has no effect. It has been left for API compatibility
|
|
278
|
+
super().__init__(nbins, steps=steps, integer=integer,
|
|
279
|
+
symmetric=symmetric, prune=prune)
|
|
280
|
+
self.create_dummy_axis()
|
|
281
|
+
|
|
282
|
+
def __call__(self, v1, v2):
|
|
283
|
+
locs = super().tick_values(v1, v2)
|
|
284
|
+
return np.array(locs), len(locs), 1 # 1: factor (see angle_helper)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class FixedLocator:
|
|
288
|
+
def __init__(self, locs):
|
|
289
|
+
self._locs = locs
|
|
290
|
+
|
|
291
|
+
def __call__(self, v1, v2):
|
|
292
|
+
v1, v2 = sorted([v1, v2])
|
|
293
|
+
locs = np.array([l for l in self._locs if v1 <= l <= v2])
|
|
294
|
+
return locs, len(locs), 1 # 1: factor (see angle_helper)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
# Tick Formatter
|
|
298
|
+
|
|
299
|
+
class FormatterPrettyPrint:
|
|
300
|
+
def __init__(self, useMathText=True):
|
|
301
|
+
self._fmt = mticker.ScalarFormatter(
|
|
302
|
+
useMathText=useMathText, useOffset=False)
|
|
303
|
+
self._fmt.create_dummy_axis()
|
|
304
|
+
|
|
305
|
+
def __call__(self, direction, factor, values):
|
|
306
|
+
return self._fmt.format_ticks(values)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
class DictFormatter:
|
|
310
|
+
def __init__(self, format_dict, formatter=None):
|
|
311
|
+
"""
|
|
312
|
+
format_dict : dictionary for format strings to be used.
|
|
313
|
+
formatter : fall-back formatter
|
|
314
|
+
"""
|
|
315
|
+
super().__init__()
|
|
316
|
+
self._format_dict = format_dict
|
|
317
|
+
self._fallback_formatter = formatter
|
|
318
|
+
|
|
319
|
+
def __call__(self, direction, factor, values):
|
|
320
|
+
"""
|
|
321
|
+
factor is ignored if value is found in the dictionary
|
|
322
|
+
"""
|
|
323
|
+
if self._fallback_formatter:
|
|
324
|
+
fallback_strings = self._fallback_formatter(
|
|
325
|
+
direction, factor, values)
|
|
326
|
+
else:
|
|
327
|
+
fallback_strings = [""] * len(values)
|
|
328
|
+
return [self._format_dict.get(k, v)
|
|
329
|
+
for k, v in zip(values, fallback_strings)]
|