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,261 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
from matplotlib_rs import _api, cbook
|
|
3
|
+
import matplotlib_rs.artist as martist
|
|
4
|
+
import matplotlib_rs.transforms as mtransforms
|
|
5
|
+
from matplotlib_rs.transforms import Bbox
|
|
6
|
+
from .mpl_axes import Axes
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ParasiteAxesBase:
|
|
10
|
+
|
|
11
|
+
def __init__(self, parent_axes, aux_transform=None,
|
|
12
|
+
*, viewlim_mode=None, **kwargs):
|
|
13
|
+
self._parent_axes = parent_axes
|
|
14
|
+
self.transAux = aux_transform
|
|
15
|
+
self.set_viewlim_mode(viewlim_mode)
|
|
16
|
+
kwargs["frameon"] = False
|
|
17
|
+
super().__init__(parent_axes.get_figure(root=False),
|
|
18
|
+
parent_axes._position, **kwargs)
|
|
19
|
+
|
|
20
|
+
def clear(self):
|
|
21
|
+
super().clear()
|
|
22
|
+
martist.setp(self.get_children(), visible=False)
|
|
23
|
+
self._get_lines = self._parent_axes._get_lines
|
|
24
|
+
self._parent_axes.callbacks._connect_picklable(
|
|
25
|
+
"xlim_changed", self._sync_lims)
|
|
26
|
+
self._parent_axes.callbacks._connect_picklable(
|
|
27
|
+
"ylim_changed", self._sync_lims)
|
|
28
|
+
|
|
29
|
+
def get_axes_locator(self):
|
|
30
|
+
return self._parent_axes.get_axes_locator()
|
|
31
|
+
|
|
32
|
+
def pick(self, mouseevent):
|
|
33
|
+
# This most likely goes to Artist.pick (depending on axes_class given
|
|
34
|
+
# to the factory), which only handles pick events registered on the
|
|
35
|
+
# axes associated with each child:
|
|
36
|
+
super().pick(mouseevent)
|
|
37
|
+
# But parasite axes are additionally given pick events from their host
|
|
38
|
+
# axes (cf. HostAxesBase.pick), which we handle here:
|
|
39
|
+
for a in self.get_children():
|
|
40
|
+
if (hasattr(mouseevent.inaxes, "parasites")
|
|
41
|
+
and self in mouseevent.inaxes.parasites):
|
|
42
|
+
a.pick(mouseevent)
|
|
43
|
+
|
|
44
|
+
# aux_transform support
|
|
45
|
+
|
|
46
|
+
def _set_lim_and_transforms(self):
|
|
47
|
+
if self.transAux is not None:
|
|
48
|
+
self.transAxes = self._parent_axes.transAxes
|
|
49
|
+
self.transData = self.transAux + self._parent_axes.transData
|
|
50
|
+
self._xaxis_transform = mtransforms.blended_transform_factory(
|
|
51
|
+
self.transData, self.transAxes)
|
|
52
|
+
self._yaxis_transform = mtransforms.blended_transform_factory(
|
|
53
|
+
self.transAxes, self.transData)
|
|
54
|
+
else:
|
|
55
|
+
super()._set_lim_and_transforms()
|
|
56
|
+
|
|
57
|
+
def set_viewlim_mode(self, mode):
|
|
58
|
+
_api.check_in_list([None, "equal", "transform"], mode=mode)
|
|
59
|
+
self._viewlim_mode = mode
|
|
60
|
+
|
|
61
|
+
def get_viewlim_mode(self):
|
|
62
|
+
return self._viewlim_mode
|
|
63
|
+
|
|
64
|
+
def _sync_lims(self, parent):
|
|
65
|
+
viewlim = parent.viewLim.frozen()
|
|
66
|
+
mode = self.get_viewlim_mode()
|
|
67
|
+
if mode is None:
|
|
68
|
+
pass
|
|
69
|
+
elif mode == "equal":
|
|
70
|
+
self.viewLim.set(viewlim)
|
|
71
|
+
elif mode == "transform":
|
|
72
|
+
self.viewLim.set(viewlim.transformed(self.transAux.inverted()))
|
|
73
|
+
else:
|
|
74
|
+
_api.check_in_list([None, "equal", "transform"], mode=mode)
|
|
75
|
+
|
|
76
|
+
# end of aux_transform support
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
parasite_axes_class_factory = cbook._make_class_factory(
|
|
80
|
+
ParasiteAxesBase, "{}Parasite")
|
|
81
|
+
ParasiteAxes = parasite_axes_class_factory(Axes)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class HostAxesBase:
|
|
85
|
+
def __init__(self, *args, **kwargs):
|
|
86
|
+
self.parasites = []
|
|
87
|
+
super().__init__(*args, **kwargs)
|
|
88
|
+
|
|
89
|
+
def get_aux_axes(
|
|
90
|
+
self, tr=None, viewlim_mode="equal", axes_class=None, **kwargs):
|
|
91
|
+
"""
|
|
92
|
+
Add a parasite axes to this host.
|
|
93
|
+
|
|
94
|
+
Despite this method's name, this should actually be thought of as an
|
|
95
|
+
``add_parasite_axes`` method.
|
|
96
|
+
|
|
97
|
+
.. versionchanged:: 3.7
|
|
98
|
+
Defaults to same base axes class as host axes.
|
|
99
|
+
|
|
100
|
+
Parameters
|
|
101
|
+
----------
|
|
102
|
+
tr : `~matplotlib.transforms.Transform` or None, default: None
|
|
103
|
+
If a `.Transform`, the following relation will hold:
|
|
104
|
+
``parasite.transData = tr + host.transData``.
|
|
105
|
+
If None, the parasite's and the host's ``transData`` are unrelated.
|
|
106
|
+
viewlim_mode : {"equal", "transform", None}, default: "equal"
|
|
107
|
+
How the parasite's view limits are set: directly equal to the
|
|
108
|
+
parent axes ("equal"), equal after application of *tr*
|
|
109
|
+
("transform"), or independently (None).
|
|
110
|
+
axes_class : subclass type of `~matplotlib.axes.Axes`, optional
|
|
111
|
+
The `~.axes.Axes` subclass that is instantiated. If None, the base
|
|
112
|
+
class of the host axes is used.
|
|
113
|
+
**kwargs
|
|
114
|
+
Other parameters are forwarded to the parasite axes constructor.
|
|
115
|
+
"""
|
|
116
|
+
if axes_class is None:
|
|
117
|
+
axes_class = self._base_axes_class
|
|
118
|
+
parasite_axes_class = parasite_axes_class_factory(axes_class)
|
|
119
|
+
ax2 = parasite_axes_class(
|
|
120
|
+
self, tr, viewlim_mode=viewlim_mode, **kwargs)
|
|
121
|
+
# note that ax2.transData == tr + ax1.transData
|
|
122
|
+
# Anything you draw in ax2 will match the ticks and grids of ax1.
|
|
123
|
+
self.parasites.append(ax2)
|
|
124
|
+
ax2._remove_method = self.parasites.remove
|
|
125
|
+
return ax2
|
|
126
|
+
|
|
127
|
+
def draw(self, renderer):
|
|
128
|
+
orig_children_len = len(self._children)
|
|
129
|
+
|
|
130
|
+
locator = self.get_axes_locator()
|
|
131
|
+
if locator:
|
|
132
|
+
pos = locator(self, renderer)
|
|
133
|
+
self.set_position(pos, which="active")
|
|
134
|
+
self.apply_aspect(pos)
|
|
135
|
+
else:
|
|
136
|
+
self.apply_aspect()
|
|
137
|
+
|
|
138
|
+
rect = self.get_position()
|
|
139
|
+
for ax in self.parasites:
|
|
140
|
+
ax.apply_aspect(rect)
|
|
141
|
+
self._children.extend(ax.get_children())
|
|
142
|
+
|
|
143
|
+
super().draw(renderer)
|
|
144
|
+
del self._children[orig_children_len:]
|
|
145
|
+
|
|
146
|
+
def clear(self):
|
|
147
|
+
super().clear()
|
|
148
|
+
for ax in self.parasites:
|
|
149
|
+
ax.clear()
|
|
150
|
+
|
|
151
|
+
def pick(self, mouseevent):
|
|
152
|
+
super().pick(mouseevent)
|
|
153
|
+
# Also pass pick events on to parasite axes and, in turn, their
|
|
154
|
+
# children (cf. ParasiteAxesBase.pick)
|
|
155
|
+
for a in self.parasites:
|
|
156
|
+
a.pick(mouseevent)
|
|
157
|
+
|
|
158
|
+
def twinx(self, axes_class=None):
|
|
159
|
+
"""
|
|
160
|
+
Create a twin of Axes with a shared x-axis but independent y-axis.
|
|
161
|
+
|
|
162
|
+
The y-axis of self will have ticks on the left and the returned axes
|
|
163
|
+
will have ticks on the right.
|
|
164
|
+
"""
|
|
165
|
+
ax = self._add_twin_axes(axes_class, sharex=self)
|
|
166
|
+
self.axis["right"].set_visible(False)
|
|
167
|
+
ax.axis["right"].set_visible(True)
|
|
168
|
+
ax.axis["left", "top", "bottom"].set_visible(False)
|
|
169
|
+
return ax
|
|
170
|
+
|
|
171
|
+
def twiny(self, axes_class=None):
|
|
172
|
+
"""
|
|
173
|
+
Create a twin of Axes with a shared y-axis but independent x-axis.
|
|
174
|
+
|
|
175
|
+
The x-axis of self will have ticks on the bottom and the returned axes
|
|
176
|
+
will have ticks on the top.
|
|
177
|
+
"""
|
|
178
|
+
ax = self._add_twin_axes(axes_class, sharey=self)
|
|
179
|
+
self.axis["top"].set_visible(False)
|
|
180
|
+
ax.axis["top"].set_visible(True)
|
|
181
|
+
ax.axis["left", "right", "bottom"].set_visible(False)
|
|
182
|
+
return ax
|
|
183
|
+
|
|
184
|
+
def twin(self, aux_trans=None, axes_class=None):
|
|
185
|
+
"""
|
|
186
|
+
Create a twin of Axes with no shared axis.
|
|
187
|
+
|
|
188
|
+
While self will have ticks on the left and bottom axis, the returned
|
|
189
|
+
axes will have ticks on the top and right axis.
|
|
190
|
+
"""
|
|
191
|
+
if aux_trans is None:
|
|
192
|
+
aux_trans = mtransforms.IdentityTransform()
|
|
193
|
+
ax = self._add_twin_axes(
|
|
194
|
+
axes_class, aux_transform=aux_trans, viewlim_mode="transform")
|
|
195
|
+
self.axis["top", "right"].set_visible(False)
|
|
196
|
+
ax.axis["top", "right"].set_visible(True)
|
|
197
|
+
ax.axis["left", "bottom"].set_visible(False)
|
|
198
|
+
return ax
|
|
199
|
+
|
|
200
|
+
def _add_twin_axes(self, axes_class, **kwargs):
|
|
201
|
+
"""
|
|
202
|
+
Helper for `.twinx`/`.twiny`/`.twin`.
|
|
203
|
+
|
|
204
|
+
*kwargs* are forwarded to the parasite axes constructor.
|
|
205
|
+
"""
|
|
206
|
+
if axes_class is None:
|
|
207
|
+
axes_class = self._base_axes_class
|
|
208
|
+
ax = parasite_axes_class_factory(axes_class)(self, **kwargs)
|
|
209
|
+
self.parasites.append(ax)
|
|
210
|
+
ax._remove_method = self._remove_any_twin
|
|
211
|
+
return ax
|
|
212
|
+
|
|
213
|
+
def _remove_any_twin(self, ax):
|
|
214
|
+
self.parasites.remove(ax)
|
|
215
|
+
restore = ["top", "right"]
|
|
216
|
+
if ax._sharex:
|
|
217
|
+
restore.remove("top")
|
|
218
|
+
if ax._sharey:
|
|
219
|
+
restore.remove("right")
|
|
220
|
+
self.axis[tuple(restore)].set_visible(True)
|
|
221
|
+
self.axis[tuple(restore)].toggle(ticklabels=False, label=False)
|
|
222
|
+
|
|
223
|
+
def get_tightbbox(self, renderer=None, *, call_axes_locator=True,
|
|
224
|
+
bbox_extra_artists=None):
|
|
225
|
+
bbs = [
|
|
226
|
+
*[ax.get_tightbbox(renderer, call_axes_locator=call_axes_locator)
|
|
227
|
+
for ax in self.parasites],
|
|
228
|
+
super().get_tightbbox(renderer,
|
|
229
|
+
call_axes_locator=call_axes_locator,
|
|
230
|
+
bbox_extra_artists=bbox_extra_artists)]
|
|
231
|
+
return Bbox.union([b for b in bbs if b.width != 0 or b.height != 0])
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
host_axes_class_factory = host_subplot_class_factory = \
|
|
235
|
+
cbook._make_class_factory(HostAxesBase, "{}HostAxes", "_base_axes_class")
|
|
236
|
+
HostAxes = SubplotHost = host_axes_class_factory(Axes)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def host_axes(*args, axes_class=Axes, figure=None, **kwargs):
|
|
240
|
+
"""
|
|
241
|
+
Create axes that can act as a hosts to parasitic axes.
|
|
242
|
+
|
|
243
|
+
Parameters
|
|
244
|
+
----------
|
|
245
|
+
figure : `~matplotlib.figure.Figure`
|
|
246
|
+
Figure to which the axes will be added. Defaults to the current figure
|
|
247
|
+
`.pyplot.gcf()`.
|
|
248
|
+
|
|
249
|
+
*args, **kwargs
|
|
250
|
+
Will be passed on to the underlying `~.axes.Axes` object creation.
|
|
251
|
+
"""
|
|
252
|
+
import matplotlib_rs.pyplot as plt
|
|
253
|
+
host_axes_class = host_axes_class_factory(axes_class)
|
|
254
|
+
if figure is None:
|
|
255
|
+
figure = plt.gcf()
|
|
256
|
+
ax = host_axes_class(figure, *args, **kwargs)
|
|
257
|
+
figure.add_axes(ax)
|
|
258
|
+
return ax
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
host_subplot = host_axes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
from .axislines import Axes
|
|
3
|
+
from .axislines import ( # noqa: F401
|
|
4
|
+
AxesZero, AxisArtistHelper, AxisArtistHelperRectlinear,
|
|
5
|
+
GridHelperBase, GridHelperRectlinear, Subplot, SubplotZero)
|
|
6
|
+
from .axis_artist import AxisArtist, GridlinesCollection # noqa: F401
|
|
7
|
+
from .grid_helper_curvelinear import GridHelperCurveLinear # noqa: F401
|
|
8
|
+
from .floating_axes import FloatingAxes, FloatingSubplot # noqa: F401
|
|
9
|
+
from matplotlib_rs.mpl_toolkits.axes_grid1.parasite_axes import (
|
|
10
|
+
host_axes_class_factory, parasite_axes_class_factory)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
ParasiteAxes = parasite_axes_class_factory(Axes)
|
|
14
|
+
HostAxes = host_axes_class_factory(Axes)
|
|
15
|
+
SubplotHost = HostAxes
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
import numpy as np
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
from matplotlib_rs.transforms import Bbox
|
|
6
|
+
from matplotlib_rs.mpl_toolkits.axisartist.grid_finder import ExtremeFinderSimple
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def select_step_degree(dv):
|
|
10
|
+
|
|
11
|
+
degree_limits_ = [1.5, 3, 7, 13, 20, 40, 70, 120, 270, 520]
|
|
12
|
+
degree_steps_ = [1, 2, 5, 10, 15, 30, 45, 90, 180, 360]
|
|
13
|
+
degree_factors = [1.] * len(degree_steps_)
|
|
14
|
+
|
|
15
|
+
minsec_limits_ = [1.5, 2.5, 3.5, 8, 11, 18, 25, 45]
|
|
16
|
+
minsec_steps_ = [1, 2, 3, 5, 10, 15, 20, 30]
|
|
17
|
+
|
|
18
|
+
minute_limits_ = np.array(minsec_limits_) / 60
|
|
19
|
+
minute_factors = [60.] * len(minute_limits_)
|
|
20
|
+
|
|
21
|
+
second_limits_ = np.array(minsec_limits_) / 3600
|
|
22
|
+
second_factors = [3600.] * len(second_limits_)
|
|
23
|
+
|
|
24
|
+
degree_limits = [*second_limits_, *minute_limits_, *degree_limits_]
|
|
25
|
+
degree_steps = [*minsec_steps_, *minsec_steps_, *degree_steps_]
|
|
26
|
+
degree_factors = [*second_factors, *minute_factors, *degree_factors]
|
|
27
|
+
|
|
28
|
+
n = np.searchsorted(degree_limits, dv)
|
|
29
|
+
step = degree_steps[n]
|
|
30
|
+
factor = degree_factors[n]
|
|
31
|
+
|
|
32
|
+
return step, factor
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def select_step_hour(dv):
|
|
36
|
+
|
|
37
|
+
hour_limits_ = [1.5, 2.5, 3.5, 5, 7, 10, 15, 21, 36]
|
|
38
|
+
hour_steps_ = [1, 2, 3, 4, 6, 8, 12, 18, 24]
|
|
39
|
+
hour_factors = [1.] * len(hour_steps_)
|
|
40
|
+
|
|
41
|
+
minsec_limits_ = [1.5, 2.5, 3.5, 4.5, 5.5, 8, 11, 14, 18, 25, 45]
|
|
42
|
+
minsec_steps_ = [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30]
|
|
43
|
+
|
|
44
|
+
minute_limits_ = np.array(minsec_limits_) / 60
|
|
45
|
+
minute_factors = [60.] * len(minute_limits_)
|
|
46
|
+
|
|
47
|
+
second_limits_ = np.array(minsec_limits_) / 3600
|
|
48
|
+
second_factors = [3600.] * len(second_limits_)
|
|
49
|
+
|
|
50
|
+
hour_limits = [*second_limits_, *minute_limits_, *hour_limits_]
|
|
51
|
+
hour_steps = [*minsec_steps_, *minsec_steps_, *hour_steps_]
|
|
52
|
+
hour_factors = [*second_factors, *minute_factors, *hour_factors]
|
|
53
|
+
|
|
54
|
+
n = np.searchsorted(hour_limits, dv)
|
|
55
|
+
step = hour_steps[n]
|
|
56
|
+
factor = hour_factors[n]
|
|
57
|
+
|
|
58
|
+
return step, factor
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def select_step_sub(dv):
|
|
62
|
+
|
|
63
|
+
# subarcsec or degree
|
|
64
|
+
tmp = 10.**(int(math.log10(dv))-1.)
|
|
65
|
+
|
|
66
|
+
factor = 1./tmp
|
|
67
|
+
|
|
68
|
+
if 1.5*tmp >= dv:
|
|
69
|
+
step = 1
|
|
70
|
+
elif 3.*tmp >= dv:
|
|
71
|
+
step = 2
|
|
72
|
+
elif 7.*tmp >= dv:
|
|
73
|
+
step = 5
|
|
74
|
+
else:
|
|
75
|
+
step = 1
|
|
76
|
+
factor = 0.1*factor
|
|
77
|
+
|
|
78
|
+
return step, factor
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def select_step(v1, v2, nv, hour=False, include_last=True,
|
|
82
|
+
threshold_factor=3600.):
|
|
83
|
+
|
|
84
|
+
if v1 > v2:
|
|
85
|
+
v1, v2 = v2, v1
|
|
86
|
+
|
|
87
|
+
dv = (v2 - v1) / nv
|
|
88
|
+
|
|
89
|
+
if hour:
|
|
90
|
+
_select_step = select_step_hour
|
|
91
|
+
cycle = 24.
|
|
92
|
+
else:
|
|
93
|
+
_select_step = select_step_degree
|
|
94
|
+
cycle = 360.
|
|
95
|
+
|
|
96
|
+
# for degree
|
|
97
|
+
if dv > 1 / threshold_factor:
|
|
98
|
+
step, factor = _select_step(dv)
|
|
99
|
+
else:
|
|
100
|
+
step, factor = select_step_sub(dv*threshold_factor)
|
|
101
|
+
|
|
102
|
+
factor = factor * threshold_factor
|
|
103
|
+
|
|
104
|
+
levs = np.arange(np.floor(v1 * factor / step),
|
|
105
|
+
np.ceil(v2 * factor / step) + 0.5,
|
|
106
|
+
dtype=int) * step
|
|
107
|
+
|
|
108
|
+
# n : number of valid levels. If there is a cycle, e.g., [0, 90, 180,
|
|
109
|
+
# 270, 360], the grid line needs to be extended from 0 to 360, so
|
|
110
|
+
# we need to return the whole array. However, the last level (360)
|
|
111
|
+
# needs to be ignored often. In this case, so we return n=4.
|
|
112
|
+
|
|
113
|
+
n = len(levs)
|
|
114
|
+
|
|
115
|
+
# we need to check the range of values
|
|
116
|
+
# for example, -90 to 90, 0 to 360,
|
|
117
|
+
|
|
118
|
+
if factor == 1. and levs[-1] >= levs[0] + cycle: # check for cycle
|
|
119
|
+
nv = int(cycle / step)
|
|
120
|
+
if include_last:
|
|
121
|
+
levs = levs[0] + np.arange(0, nv+1, 1) * step
|
|
122
|
+
else:
|
|
123
|
+
levs = levs[0] + np.arange(0, nv, 1) * step
|
|
124
|
+
|
|
125
|
+
n = len(levs)
|
|
126
|
+
|
|
127
|
+
return np.array(levs), n, factor
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def select_step24(v1, v2, nv, include_last=True, threshold_factor=3600):
|
|
131
|
+
v1, v2 = v1 / 15, v2 / 15
|
|
132
|
+
levs, n, factor = select_step(v1, v2, nv, hour=True,
|
|
133
|
+
include_last=include_last,
|
|
134
|
+
threshold_factor=threshold_factor)
|
|
135
|
+
return levs * 15, n, factor
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def select_step360(v1, v2, nv, include_last=True, threshold_factor=3600):
|
|
139
|
+
return select_step(v1, v2, nv, hour=False,
|
|
140
|
+
include_last=include_last,
|
|
141
|
+
threshold_factor=threshold_factor)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class LocatorBase:
|
|
145
|
+
def __init__(self, nbins, include_last=True):
|
|
146
|
+
self.nbins = nbins
|
|
147
|
+
self._include_last = include_last
|
|
148
|
+
|
|
149
|
+
def set_params(self, nbins=None):
|
|
150
|
+
if nbins is not None:
|
|
151
|
+
self.nbins = int(nbins)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class LocatorHMS(LocatorBase):
|
|
155
|
+
def __call__(self, v1, v2):
|
|
156
|
+
return select_step24(v1, v2, self.nbins, self._include_last)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class LocatorHM(LocatorBase):
|
|
160
|
+
def __call__(self, v1, v2):
|
|
161
|
+
return select_step24(v1, v2, self.nbins, self._include_last,
|
|
162
|
+
threshold_factor=60)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class LocatorH(LocatorBase):
|
|
166
|
+
def __call__(self, v1, v2):
|
|
167
|
+
return select_step24(v1, v2, self.nbins, self._include_last,
|
|
168
|
+
threshold_factor=1)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class LocatorDMS(LocatorBase):
|
|
172
|
+
def __call__(self, v1, v2):
|
|
173
|
+
return select_step360(v1, v2, self.nbins, self._include_last)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class LocatorDM(LocatorBase):
|
|
177
|
+
def __call__(self, v1, v2):
|
|
178
|
+
return select_step360(v1, v2, self.nbins, self._include_last,
|
|
179
|
+
threshold_factor=60)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class LocatorD(LocatorBase):
|
|
183
|
+
def __call__(self, v1, v2):
|
|
184
|
+
return select_step360(v1, v2, self.nbins, self._include_last,
|
|
185
|
+
threshold_factor=1)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class FormatterDMS:
|
|
189
|
+
deg_mark = r"^{\circ}"
|
|
190
|
+
min_mark = r"^{\prime}"
|
|
191
|
+
sec_mark = r"^{\prime\prime}"
|
|
192
|
+
|
|
193
|
+
fmt_d = "$%d" + deg_mark + "$"
|
|
194
|
+
fmt_ds = r"$%d.%s" + deg_mark + "$"
|
|
195
|
+
|
|
196
|
+
# %s for sign
|
|
197
|
+
fmt_d_m = r"$%s%d" + deg_mark + r"\,%02d" + min_mark + "$"
|
|
198
|
+
fmt_d_ms = r"$%s%d" + deg_mark + r"\,%02d.%s" + min_mark + "$"
|
|
199
|
+
|
|
200
|
+
fmt_d_m_partial = "$%s%d" + deg_mark + r"\,%02d" + min_mark + r"\,"
|
|
201
|
+
fmt_s_partial = "%02d" + sec_mark + "$"
|
|
202
|
+
fmt_ss_partial = "%02d.%s" + sec_mark + "$"
|
|
203
|
+
|
|
204
|
+
def _get_number_fraction(self, factor):
|
|
205
|
+
## check for fractional numbers
|
|
206
|
+
number_fraction = None
|
|
207
|
+
# check for 60
|
|
208
|
+
|
|
209
|
+
for threshold in [1, 60, 3600]:
|
|
210
|
+
if factor <= threshold:
|
|
211
|
+
break
|
|
212
|
+
|
|
213
|
+
d = factor // threshold
|
|
214
|
+
int_log_d = int(np.floor(np.log10(d)))
|
|
215
|
+
if 10**int_log_d == d and d != 1:
|
|
216
|
+
number_fraction = int_log_d
|
|
217
|
+
factor = factor // 10**int_log_d
|
|
218
|
+
return factor, number_fraction
|
|
219
|
+
|
|
220
|
+
return factor, number_fraction
|
|
221
|
+
|
|
222
|
+
def __call__(self, direction, factor, values):
|
|
223
|
+
if len(values) == 0:
|
|
224
|
+
return []
|
|
225
|
+
|
|
226
|
+
ss = np.sign(values)
|
|
227
|
+
signs = ["-" if v < 0 else "" for v in values]
|
|
228
|
+
|
|
229
|
+
factor, number_fraction = self._get_number_fraction(factor)
|
|
230
|
+
|
|
231
|
+
values = np.abs(values)
|
|
232
|
+
|
|
233
|
+
if number_fraction is not None:
|
|
234
|
+
values, frac_part = divmod(values, 10 ** number_fraction)
|
|
235
|
+
frac_fmt = "%%0%dd" % (number_fraction,)
|
|
236
|
+
frac_str = [frac_fmt % (f1,) for f1 in frac_part]
|
|
237
|
+
|
|
238
|
+
if factor == 1:
|
|
239
|
+
if number_fraction is None:
|
|
240
|
+
return [self.fmt_d % (s * int(v),) for s, v in zip(ss, values)]
|
|
241
|
+
else:
|
|
242
|
+
return [self.fmt_ds % (s * int(v), f1)
|
|
243
|
+
for s, v, f1 in zip(ss, values, frac_str)]
|
|
244
|
+
elif factor == 60:
|
|
245
|
+
deg_part, min_part = divmod(values, 60)
|
|
246
|
+
if number_fraction is None:
|
|
247
|
+
return [self.fmt_d_m % (s1, d1, m1)
|
|
248
|
+
for s1, d1, m1 in zip(signs, deg_part, min_part)]
|
|
249
|
+
else:
|
|
250
|
+
return [self.fmt_d_ms % (s, d1, m1, f1)
|
|
251
|
+
for s, d1, m1, f1
|
|
252
|
+
in zip(signs, deg_part, min_part, frac_str)]
|
|
253
|
+
|
|
254
|
+
elif factor == 3600:
|
|
255
|
+
if ss[-1] == -1:
|
|
256
|
+
inverse_order = True
|
|
257
|
+
values = values[::-1]
|
|
258
|
+
signs = signs[::-1]
|
|
259
|
+
else:
|
|
260
|
+
inverse_order = False
|
|
261
|
+
|
|
262
|
+
l_hm_old = ""
|
|
263
|
+
r = []
|
|
264
|
+
|
|
265
|
+
deg_part, min_part_ = divmod(values, 3600)
|
|
266
|
+
min_part, sec_part = divmod(min_part_, 60)
|
|
267
|
+
|
|
268
|
+
if number_fraction is None:
|
|
269
|
+
sec_str = [self.fmt_s_partial % (s1,) for s1 in sec_part]
|
|
270
|
+
else:
|
|
271
|
+
sec_str = [self.fmt_ss_partial % (s1, f1)
|
|
272
|
+
for s1, f1 in zip(sec_part, frac_str)]
|
|
273
|
+
|
|
274
|
+
for s, d1, m1, s1 in zip(signs, deg_part, min_part, sec_str):
|
|
275
|
+
l_hm = self.fmt_d_m_partial % (s, d1, m1)
|
|
276
|
+
if l_hm != l_hm_old:
|
|
277
|
+
l_hm_old = l_hm
|
|
278
|
+
l = l_hm + s1
|
|
279
|
+
else:
|
|
280
|
+
l = "$" + s + s1
|
|
281
|
+
r.append(l)
|
|
282
|
+
|
|
283
|
+
if inverse_order:
|
|
284
|
+
return r[::-1]
|
|
285
|
+
else:
|
|
286
|
+
return r
|
|
287
|
+
|
|
288
|
+
else: # factor > 3600.
|
|
289
|
+
return [r"$%s^{\circ}$" % v for v in ss*values]
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
class FormatterHMS(FormatterDMS):
|
|
293
|
+
deg_mark = r"^\mathrm{h}"
|
|
294
|
+
min_mark = r"^\mathrm{m}"
|
|
295
|
+
sec_mark = r"^\mathrm{s}"
|
|
296
|
+
|
|
297
|
+
fmt_d = "$%d" + deg_mark + "$"
|
|
298
|
+
fmt_ds = r"$%d.%s" + deg_mark + "$"
|
|
299
|
+
|
|
300
|
+
# %s for sign
|
|
301
|
+
fmt_d_m = r"$%s%d" + deg_mark + r"\,%02d" + min_mark+"$"
|
|
302
|
+
fmt_d_ms = r"$%s%d" + deg_mark + r"\,%02d.%s" + min_mark+"$"
|
|
303
|
+
|
|
304
|
+
fmt_d_m_partial = "$%s%d" + deg_mark + r"\,%02d" + min_mark + r"\,"
|
|
305
|
+
fmt_s_partial = "%02d" + sec_mark + "$"
|
|
306
|
+
fmt_ss_partial = "%02d.%s" + sec_mark + "$"
|
|
307
|
+
|
|
308
|
+
def __call__(self, direction, factor, values): # hour
|
|
309
|
+
return super().__call__(direction, factor, np.asarray(values) / 15)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class ExtremeFinderCycle(ExtremeFinderSimple):
|
|
313
|
+
# docstring inherited
|
|
314
|
+
|
|
315
|
+
def __init__(self, nx, ny,
|
|
316
|
+
lon_cycle=360., lat_cycle=None,
|
|
317
|
+
lon_minmax=None, lat_minmax=(-90, 90)):
|
|
318
|
+
"""
|
|
319
|
+
This subclass handles the case where one or both coordinates should be
|
|
320
|
+
taken modulo 360, or be restricted to not exceed a specific range.
|
|
321
|
+
|
|
322
|
+
Parameters
|
|
323
|
+
----------
|
|
324
|
+
nx, ny : int
|
|
325
|
+
The number of samples in each direction.
|
|
326
|
+
|
|
327
|
+
lon_cycle, lat_cycle : 360 or None
|
|
328
|
+
If not None, values in the corresponding direction are taken modulo
|
|
329
|
+
*lon_cycle* or *lat_cycle*; in theory this can be any number but
|
|
330
|
+
the implementation actually assumes that it is 360 (if not None);
|
|
331
|
+
other values give nonsensical results.
|
|
332
|
+
|
|
333
|
+
This is done by "unwrapping" the transformed grid coordinates so
|
|
334
|
+
that jumps are less than a half-cycle; then normalizing the span to
|
|
335
|
+
no more than a full cycle.
|
|
336
|
+
|
|
337
|
+
For example, if values are in the union of the [0, 2] and
|
|
338
|
+
[358, 360] intervals (typically, angles measured modulo 360), the
|
|
339
|
+
values in the second interval are normalized to [-2, 0] instead so
|
|
340
|
+
that the values now cover [-2, 2]. If values are in a range of
|
|
341
|
+
[5, 1000], this gets normalized to [5, 365].
|
|
342
|
+
|
|
343
|
+
lon_minmax, lat_minmax : (float, float) or None
|
|
344
|
+
If not None, the computed bounding box is clipped to the given
|
|
345
|
+
range in the corresponding direction.
|
|
346
|
+
"""
|
|
347
|
+
self.nx, self.ny = nx, ny
|
|
348
|
+
self.lon_cycle, self.lat_cycle = lon_cycle, lat_cycle
|
|
349
|
+
self.lon_minmax = lon_minmax
|
|
350
|
+
self.lat_minmax = lat_minmax
|
|
351
|
+
|
|
352
|
+
def _find_transformed_bbox(self, trans, bbox):
|
|
353
|
+
# docstring inherited
|
|
354
|
+
grid = np.reshape(np.meshgrid(np.linspace(bbox.x0, bbox.x1, self.nx),
|
|
355
|
+
np.linspace(bbox.y0, bbox.y1, self.ny)),
|
|
356
|
+
(2, -1)).T
|
|
357
|
+
lon, lat = trans.transform(grid).T
|
|
358
|
+
|
|
359
|
+
# iron out jumps, but algorithm should be improved.
|
|
360
|
+
# This is just naive way of doing and my fail for some cases.
|
|
361
|
+
# Consider replacing this with numpy.unwrap
|
|
362
|
+
# We are ignoring invalid warnings. They are triggered when
|
|
363
|
+
# comparing arrays with NaNs using > We are already handling
|
|
364
|
+
# that correctly using np.nanmin and np.nanmax
|
|
365
|
+
with np.errstate(invalid='ignore'):
|
|
366
|
+
if self.lon_cycle is not None:
|
|
367
|
+
lon0 = np.nanmin(lon)
|
|
368
|
+
lon -= 360. * ((lon - lon0) > 180.)
|
|
369
|
+
if self.lat_cycle is not None:
|
|
370
|
+
lat0 = np.nanmin(lat)
|
|
371
|
+
lat -= 360. * ((lat - lat0) > 180.)
|
|
372
|
+
|
|
373
|
+
tbbox = Bbox.null()
|
|
374
|
+
tbbox.update_from_data_xy(np.column_stack([lon, lat]))
|
|
375
|
+
tbbox = tbbox.expanded(1 + 2 / self.nx, 1 + 2 / self.ny)
|
|
376
|
+
lon_min, lat_min, lon_max, lat_max = tbbox.extents
|
|
377
|
+
|
|
378
|
+
# check cycle
|
|
379
|
+
if self.lon_cycle:
|
|
380
|
+
lon_max = min(lon_max, lon_min + self.lon_cycle)
|
|
381
|
+
if self.lat_cycle:
|
|
382
|
+
lat_max = min(lat_max, lat_min + self.lat_cycle)
|
|
383
|
+
|
|
384
|
+
if self.lon_minmax is not None:
|
|
385
|
+
min0 = self.lon_minmax[0]
|
|
386
|
+
lon_min = max(min0, lon_min)
|
|
387
|
+
max0 = self.lon_minmax[1]
|
|
388
|
+
lon_max = min(max0, lon_max)
|
|
389
|
+
|
|
390
|
+
if self.lat_minmax is not None:
|
|
391
|
+
min0 = self.lat_minmax[0]
|
|
392
|
+
lat_min = max(min0, lat_min)
|
|
393
|
+
max0 = self.lat_minmax[1]
|
|
394
|
+
lat_max = min(max0, lat_max)
|
|
395
|
+
|
|
396
|
+
return Bbox.from_extents(lon_min, lat_min, lon_max, lat_max)
|