matplotlib-rs 0.0.8__cp315-cp315-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docs/releases/0.0.1.md +268 -0
- docs/releases/0.0.2.md +69 -0
- docs/releases/0.0.3.md +80 -0
- docs/releases/0.0.4.md +73 -0
- docs/releases/0.0.5.md +24 -0
- docs/releases/0.0.6.md +24 -0
- docs/releases/0.0.7.md +24 -0
- docs/releases/0.0.8.md +16 -0
- licenses/LICENSE_CONTOURPY +29 -0
- licenses/LICENSE_CYCLER +27 -0
- licenses/LICENSE_DATEUTIL +54 -0
- licenses/LICENSE_KIWISOLVER +71 -0
- licenses/LICENSE_LIBWEBP +56 -0
- licenses/LICENSE_MATPLOTLIB +1253 -0
- licenses/LICENSE_PYPARSING +20 -0
- licenses/LICENSE_QHULL +39 -0
- licenses/LICENSE_SIX +18 -0
- matplotlib_rs/__init__.py +1683 -0
- matplotlib_rs/__main__.py +27 -0
- matplotlib_rs/_afm.py +500 -0
- matplotlib_rs/_animation_data.py +263 -0
- matplotlib_rs/_api/__init__.py +495 -0
- matplotlib_rs/_api/deprecation.py +534 -0
- matplotlib_rs/_axis_py.py +2991 -0
- matplotlib_rs/_blocking_input.py +31 -0
- matplotlib_rs/_cm.py +1500 -0
- matplotlib_rs/_cm_bivar.py +1289 -0
- matplotlib_rs/_cm_listed.py +2848 -0
- matplotlib_rs/_cm_multivar.py +167 -0
- matplotlib_rs/_color_data.py +1142 -0
- matplotlib_rs/_colormap.py +132 -0
- matplotlib_rs/_constrained_layout.py +825 -0
- matplotlib_rs/_contour.py +108 -0
- matplotlib_rs/_doc_cache.py +12214 -0
- matplotlib_rs/_docstring.py +142 -0
- matplotlib_rs/_enums.py +178 -0
- matplotlib_rs/_figure_rs.py +294 -0
- matplotlib_rs/_fontconfig_pattern.py +129 -0
- matplotlib_rs/_foreign.py +220 -0
- matplotlib_rs/_hook.py +94 -0
- matplotlib_rs/_image.py +160 -0
- matplotlib_rs/_imageio.py +229 -0
- matplotlib_rs/_internal_utils.py +65 -0
- matplotlib_rs/_kiwi.py +484 -0
- matplotlib_rs/_layoutgrid.py +549 -0
- matplotlib_rs/_live.py +192 -0
- matplotlib_rs/_mathtext.py +3103 -0
- matplotlib_rs/_mathtext_data.py +1811 -0
- matplotlib_rs/_mplrs.cp315-win_amd64.pyd +0 -0
- matplotlib_rs/_path.py +25 -0
- matplotlib_rs/_png.py +162 -0
- matplotlib_rs/_pylab_helpers.py +137 -0
- matplotlib_rs/_qhull.py +66 -0
- matplotlib_rs/_rcpush.py +84 -0
- matplotlib_rs/_spines_rs.py +108 -0
- matplotlib_rs/_style_helpers.py +52 -0
- matplotlib_rs/_text_helpers.py +51 -0
- matplotlib_rs/_tight_bbox.py +85 -0
- matplotlib_rs/_tight_layout.py +302 -0
- matplotlib_rs/_tri.py +140 -0
- matplotlib_rs/_type1font.py +1228 -0
- matplotlib_rs/_vendor/__init__.py +8 -0
- matplotlib_rs/_vendor/cycler.py +574 -0
- matplotlib_rs/_vendor/dateutil/__init__.py +27 -0
- matplotlib_rs/_vendor/dateutil/_common.py +44 -0
- matplotlib_rs/_vendor/dateutil/_tzdata_impl.py +148 -0
- matplotlib_rs/_vendor/dateutil/_version.py +5 -0
- matplotlib_rs/_vendor/dateutil/easter.py +90 -0
- matplotlib_rs/_vendor/dateutil/parser/__init__.py +62 -0
- matplotlib_rs/_vendor/dateutil/parser/_parser.py +1614 -0
- matplotlib_rs/_vendor/dateutil/parser/isoparser.py +417 -0
- matplotlib_rs/_vendor/dateutil/relativedelta.py +597 -0
- matplotlib_rs/_vendor/dateutil/rrule.py +1765 -0
- matplotlib_rs/_vendor/dateutil/tz/__init__.py +61 -0
- matplotlib_rs/_vendor/dateutil/tz/_common.py +420 -0
- matplotlib_rs/_vendor/dateutil/tz/_factories.py +81 -0
- matplotlib_rs/_vendor/dateutil/tz/_tzfile.py +1429 -0
- matplotlib_rs/_vendor/dateutil/tz/_tzpath.py +105 -0
- matplotlib_rs/_vendor/dateutil/tz/tz.py +1473 -0
- matplotlib_rs/_vendor/dateutil/tz/win.py +371 -0
- matplotlib_rs/_vendor/dateutil/tzwin.py +3 -0
- matplotlib_rs/_vendor/dateutil/utils.py +72 -0
- matplotlib_rs/_vendor/dateutil/zoneinfo/__init__.py +234 -0
- matplotlib_rs/_vendor/pyparsing/__init__.py +414 -0
- matplotlib_rs/_vendor/pyparsing/actions.py +265 -0
- matplotlib_rs/_vendor/pyparsing/common.py +571 -0
- matplotlib_rs/_vendor/pyparsing/core.py +6973 -0
- matplotlib_rs/_vendor/pyparsing/exceptions.py +354 -0
- matplotlib_rs/_vendor/pyparsing/helpers.py +1770 -0
- matplotlib_rs/_vendor/pyparsing/results.py +929 -0
- matplotlib_rs/_vendor/pyparsing/testing.py +399 -0
- matplotlib_rs/_vendor/pyparsing/unicode.py +357 -0
- matplotlib_rs/_vendor/pyparsing/util.py +515 -0
- matplotlib_rs/_vendor/pyparsing/warnings.py +11 -0
- matplotlib_rs/_vendor/six.py +1004 -0
- matplotlib_rs/animation.py +1843 -0
- matplotlib_rs/artist.py +2302 -0
- matplotlib_rs/axes/__init__.py +19 -0
- matplotlib_rs/axes/_axes.py +9402 -0
- matplotlib_rs/axes/_bar.py +185 -0
- matplotlib_rs/axes/_base.py +5236 -0
- matplotlib_rs/axes/_base_rs.py +727 -0
- matplotlib_rs/axes/_boxplot.py +391 -0
- matplotlib_rs/axes/_hist.py +99 -0
- matplotlib_rs/axes/_secondary_axes.py +357 -0
- matplotlib_rs/axis.py +1963 -0
- matplotlib_rs/backend_bases.py +3760 -0
- matplotlib_rs/backend_managers.py +388 -0
- matplotlib_rs/backend_tools.py +1002 -0
- matplotlib_rs/backends/__init__.py +6 -0
- matplotlib_rs/backends/_backend_pdf_ps.py +451 -0
- matplotlib_rs/backends/backend_agg.py +552 -0
- matplotlib_rs/backends/backend_mixed.py +123 -0
- matplotlib_rs/backends/backend_pdf.py +2711 -0
- matplotlib_rs/backends/backend_pgf.py +1031 -0
- matplotlib_rs/backends/backend_ps.py +1491 -0
- matplotlib_rs/backends/backend_svg.py +1395 -0
- matplotlib_rs/backends/backend_template.py +214 -0
- matplotlib_rs/backends/registry.py +423 -0
- matplotlib_rs/bezier.py +691 -0
- matplotlib_rs/category.py +236 -0
- matplotlib_rs/cbook.py +2762 -0
- matplotlib_rs/cm.py +251 -0
- matplotlib_rs/collections.py +2711 -0
- matplotlib_rs/colorbar.py +1586 -0
- matplotlib_rs/colorizer.py +909 -0
- matplotlib_rs/colors.py +4278 -0
- matplotlib_rs/container.py +256 -0
- matplotlib_rs/contour.py +1756 -0
- matplotlib_rs/dates.py +1847 -0
- matplotlib_rs/dviread.py +1386 -0
- matplotlib_rs/figure.py +3815 -0
- matplotlib_rs/font_manager.py +1855 -0
- matplotlib_rs/ft2font.py +515 -0
- matplotlib_rs/gridspec.py +808 -0
- matplotlib_rs/hatch.py +244 -0
- matplotlib_rs/image.py +1863 -0
- matplotlib_rs/inset.py +291 -0
- matplotlib_rs/layout_engine.py +310 -0
- matplotlib_rs/legend.py +1480 -0
- matplotlib_rs/legend_handler.py +812 -0
- matplotlib_rs/lines.py +1886 -0
- matplotlib_rs/markers.py +908 -0
- matplotlib_rs/mathtext.py +141 -0
- matplotlib_rs/mlab.py +959 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-BoldOblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans-Oblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSans.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Bold.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-BoldOblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono-Oblique.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSansMono.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Bold.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-BoldItalic.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif-Italic.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerif.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/LICENSE_DEJAVU +99 -0
- matplotlib_rs/mpl-data/fonts/ttf/LICENSE_STIX +124 -0
- matplotlib_rs/mpl-data/fonts/ttf/LastResortHE-Regular.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneral.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXGeneralItalic.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUni.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXNonUniIta.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmb10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmex10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmmi10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmr10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmss10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmsy10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmti10.ttf +0 -0
- matplotlib_rs/mpl-data/fonts/ttf/cmtt10.ttf +0 -0
- matplotlib_rs/mpl-data/images/back-symbolic.svg +46 -0
- matplotlib_rs/mpl-data/images/back.pdf +0 -0
- matplotlib_rs/mpl-data/images/back.png +0 -0
- matplotlib_rs/mpl-data/images/back.svg +46 -0
- matplotlib_rs/mpl-data/images/back_large.png +0 -0
- matplotlib_rs/mpl-data/images/filesave-symbolic.svg +68 -0
- matplotlib_rs/mpl-data/images/filesave.pdf +72 -0
- matplotlib_rs/mpl-data/images/filesave.png +0 -0
- matplotlib_rs/mpl-data/images/filesave.svg +68 -0
- matplotlib_rs/mpl-data/images/filesave_large.png +0 -0
- matplotlib_rs/mpl-data/images/forward-symbolic.svg +46 -0
- matplotlib_rs/mpl-data/images/forward.pdf +0 -0
- matplotlib_rs/mpl-data/images/forward.png +0 -0
- matplotlib_rs/mpl-data/images/forward.svg +46 -0
- matplotlib_rs/mpl-data/images/forward_large.png +0 -0
- matplotlib_rs/mpl-data/images/hand.pdf +0 -0
- matplotlib_rs/mpl-data/images/hand.png +0 -0
- matplotlib_rs/mpl-data/images/hand.svg +130 -0
- matplotlib_rs/mpl-data/images/help-symbolic.svg +52 -0
- matplotlib_rs/mpl-data/images/help.pdf +71 -0
- matplotlib_rs/mpl-data/images/help.png +0 -0
- matplotlib_rs/mpl-data/images/help.svg +52 -0
- matplotlib_rs/mpl-data/images/help_large.png +0 -0
- matplotlib_rs/mpl-data/images/home-symbolic.svg +59 -0
- matplotlib_rs/mpl-data/images/home.pdf +0 -0
- matplotlib_rs/mpl-data/images/home.png +0 -0
- matplotlib_rs/mpl-data/images/home.svg +59 -0
- matplotlib_rs/mpl-data/images/home_large.png +0 -0
- matplotlib_rs/mpl-data/images/matplotlib.pdf +0 -0
- matplotlib_rs/mpl-data/images/matplotlib.png +0 -0
- matplotlib_rs/mpl-data/images/matplotlib.svg +3171 -0
- matplotlib_rs/mpl-data/images/matplotlib_large.png +0 -0
- matplotlib_rs/mpl-data/images/move-symbolic.svg +73 -0
- matplotlib_rs/mpl-data/images/move.pdf +0 -0
- matplotlib_rs/mpl-data/images/move.png +0 -0
- matplotlib_rs/mpl-data/images/move.svg +73 -0
- matplotlib_rs/mpl-data/images/move_large.png +0 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options.pdf +0 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options.png +0 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options.svg +48 -0
- matplotlib_rs/mpl-data/images/qt4_editor_options_large.png +0 -0
- matplotlib_rs/mpl-data/images/subplots-symbolic.svg +81 -0
- matplotlib_rs/mpl-data/images/subplots.pdf +0 -0
- matplotlib_rs/mpl-data/images/subplots.png +0 -0
- matplotlib_rs/mpl-data/images/subplots.svg +81 -0
- matplotlib_rs/mpl-data/images/subplots_large.png +0 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect-symbolic.svg +40 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect.pdf +69 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect.png +0 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect.svg +40 -0
- matplotlib_rs/mpl-data/images/zoom_to_rect_large.png +0 -0
- matplotlib_rs/mpl-data/kpsewhich.lua +4 -0
- matplotlib_rs/mpl-data/matplotlibrc +849 -0
- matplotlib_rs/mpl-data/plot_directive/plot_directive.css +16 -0
- matplotlib_rs/mpl-data/sample_data/Minduka_Present_Blue_Pack.png +0 -0
- matplotlib_rs/mpl-data/sample_data/README.txt +2 -0
- matplotlib_rs/mpl-data/sample_data/Stocks.csv +526 -0
- matplotlib_rs/mpl-data/sample_data/axes_grid/bivariate_normal.npy +0 -0
- matplotlib_rs/mpl-data/sample_data/data_x_x2_x3.csv +11 -0
- matplotlib_rs/mpl-data/sample_data/eeg.dat +0 -0
- matplotlib_rs/mpl-data/sample_data/embedding_in_wx3.xrc +65 -0
- matplotlib_rs/mpl-data/sample_data/goog.npz +0 -0
- matplotlib_rs/mpl-data/sample_data/grace_hopper.jpg +0 -0
- matplotlib_rs/mpl-data/sample_data/jacksboro_fault_dem.npz +0 -0
- matplotlib_rs/mpl-data/sample_data/logo2.png +0 -0
- matplotlib_rs/mpl-data/sample_data/membrane.dat +0 -0
- matplotlib_rs/mpl-data/sample_data/msft.csv +66 -0
- matplotlib_rs/mpl-data/sample_data/s1045.ima.gz +0 -0
- matplotlib_rs/mpl-data/sample_data/topobathy.npz +0 -0
- matplotlib_rs/mpl-data/stylelib/Solarize_Light2.mplstyle +53 -0
- matplotlib_rs/mpl-data/stylelib/_classic_test_patch.mplstyle +8 -0
- matplotlib_rs/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle +19 -0
- matplotlib_rs/mpl-data/stylelib/_mpl-gallery.mplstyle +19 -0
- matplotlib_rs/mpl-data/stylelib/bmh.mplstyle +27 -0
- matplotlib_rs/mpl-data/stylelib/classic.mplstyle +491 -0
- matplotlib_rs/mpl-data/stylelib/dark_background.mplstyle +26 -0
- matplotlib_rs/mpl-data/stylelib/fast.mplstyle +11 -0
- matplotlib_rs/mpl-data/stylelib/fivethirtyeight.mplstyle +37 -0
- matplotlib_rs/mpl-data/stylelib/ggplot.mplstyle +39 -0
- matplotlib_rs/mpl-data/stylelib/grayscale.mplstyle +29 -0
- matplotlib_rs/mpl-data/stylelib/petroff10.mplstyle +5 -0
- matplotlib_rs/mpl-data/stylelib/petroff6.mplstyle +5 -0
- matplotlib_rs/mpl-data/stylelib/petroff8.mplstyle +5 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle +3 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle +21 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-white.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle +30 -0
- matplotlib_rs/mpl-data/stylelib/seaborn-v0_8.mplstyle +57 -0
- matplotlib_rs/mpl-data/stylelib/tableau-colorblind10.mplstyle +3 -0
- matplotlib_rs/mpl_toolkits/__init__.py +3 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/__init__.py +11 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/anchored_artists.py +415 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_divider.py +619 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_grid.py +565 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_rgb.py +158 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/axes_size.py +272 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/inset_locator.py +525 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/mpl_axes.py +129 -0
- matplotlib_rs/mpl_toolkits/axes_grid1/parasite_axes.py +261 -0
- matplotlib_rs/mpl_toolkits/axisartist/__init__.py +15 -0
- matplotlib_rs/mpl_toolkits/axisartist/angle_helper.py +396 -0
- matplotlib_rs/mpl_toolkits/axisartist/axes_divider.py +3 -0
- matplotlib_rs/mpl_toolkits/axisartist/axis_artist.py +1148 -0
- matplotlib_rs/mpl_toolkits/axisartist/axisline_style.py +193 -0
- matplotlib_rs/mpl_toolkits/axisartist/axislines.py +475 -0
- matplotlib_rs/mpl_toolkits/axisartist/floating_axes.py +265 -0
- matplotlib_rs/mpl_toolkits/axisartist/grid_finder.py +329 -0
- matplotlib_rs/mpl_toolkits/axisartist/grid_helper_curvelinear.py +353 -0
- matplotlib_rs/mpl_toolkits/axisartist/parasite_axes.py +8 -0
- matplotlib_rs/mpl_toolkits/mplot3d/__init__.py +4 -0
- matplotlib_rs/mpl_toolkits/mplot3d/art3d.py +1758 -0
- matplotlib_rs/mpl_toolkits/mplot3d/axes3d.py +4462 -0
- matplotlib_rs/mpl_toolkits/mplot3d/axis3d.py +807 -0
- matplotlib_rs/mpl_toolkits/mplot3d/proj3d.py +270 -0
- matplotlib_rs/offsetbox.py +1726 -0
- matplotlib_rs/patches.py +5049 -0
- matplotlib_rs/path.py +1147 -0
- matplotlib_rs/patheffects.py +512 -0
- matplotlib_rs/projections/__init__.py +126 -0
- matplotlib_rs/projections/geo.py +512 -0
- matplotlib_rs/projections/polar.py +1518 -0
- matplotlib_rs/pylab.py +68 -0
- matplotlib_rs/pyplot.py +4834 -0
- matplotlib_rs/quiver.py +1236 -0
- matplotlib_rs/rcsetup.py +3435 -0
- matplotlib_rs/sankey.py +815 -0
- matplotlib_rs/scale.py +1002 -0
- matplotlib_rs/spines.py +618 -0
- matplotlib_rs/stackplot.py +144 -0
- matplotlib_rs/streamplot.py +768 -0
- matplotlib_rs/style/__init__.py +269 -0
- matplotlib_rs/style/core.py +28 -0
- matplotlib_rs/table.py +860 -0
- matplotlib_rs/texmanager.py +375 -0
- matplotlib_rs/text.py +2412 -0
- matplotlib_rs/textpath.py +377 -0
- matplotlib_rs/ticker.py +3111 -0
- matplotlib_rs/transforms.py +3069 -0
- matplotlib_rs/tri/__init__.py +24 -0
- matplotlib_rs/tri/_triangulation.py +248 -0
- matplotlib_rs/tri/_tricontour.py +271 -0
- matplotlib_rs/tri/_trifinder.py +97 -0
- matplotlib_rs/tri/_triinterpolate.py +1575 -0
- matplotlib_rs/tri/_tripcolor.py +170 -0
- matplotlib_rs/tri/_triplot.py +87 -0
- matplotlib_rs/tri/_trirefine.py +308 -0
- matplotlib_rs/tri/_tritools.py +264 -0
- matplotlib_rs/typing.py +597 -0
- matplotlib_rs/units.py +196 -0
- matplotlib_rs/widgets.py +4455 -0
- matplotlib_rs-0.0.8.dist-info/METADATA +392 -0
- matplotlib_rs-0.0.8.dist-info/RECORD +352 -0
- matplotlib_rs-0.0.8.dist-info/WHEEL +4 -0
- matplotlib_rs-0.0.8.dist-info/sboms/matplotlib-rs.cyclonedx.json +4390 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
"""
|
|
3
|
+
A fully functional, do-nothing backend intended as a template for backend
|
|
4
|
+
writers. It is fully functional in that you can select it as a backend e.g.
|
|
5
|
+
with ::
|
|
6
|
+
|
|
7
|
+
import matplotlib_rs as matplotlib
|
|
8
|
+
matplotlib.use("template")
|
|
9
|
+
|
|
10
|
+
and your program will (should!) run without error, though no output is
|
|
11
|
+
produced. This provides a starting point for backend writers; you can
|
|
12
|
+
selectively implement drawing methods (`~.RendererTemplate.draw_path`,
|
|
13
|
+
`~.RendererTemplate.draw_image`, etc.) and slowly see your figure come to life
|
|
14
|
+
instead having to have a full-blown implementation before getting any results.
|
|
15
|
+
|
|
16
|
+
Copy this file to a directory outside the Matplotlib source tree, somewhere
|
|
17
|
+
where Python can import it (by adding the directory to your ``sys.path`` or by
|
|
18
|
+
packaging it as a normal Python package); if the backend is importable as
|
|
19
|
+
``import my.backend`` you can then select it using ::
|
|
20
|
+
|
|
21
|
+
import matplotlib_rs as matplotlib
|
|
22
|
+
matplotlib.use("module://my.backend")
|
|
23
|
+
|
|
24
|
+
If your backend implements support for saving figures (i.e. has a ``print_xyz`` method),
|
|
25
|
+
you can register it as the default handler for a given file type::
|
|
26
|
+
|
|
27
|
+
from matplotlib_rs.backend_bases import register_backend
|
|
28
|
+
register_backend('xyz', 'my_backend', 'XYZ File Format')
|
|
29
|
+
...
|
|
30
|
+
plt.savefig("figure.xyz")
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
from matplotlib_rs import _api
|
|
34
|
+
from matplotlib_rs._pylab_helpers import Gcf
|
|
35
|
+
from matplotlib_rs.backend_bases import (
|
|
36
|
+
FigureCanvasBase, FigureManagerBase, GraphicsContextBase, RendererBase)
|
|
37
|
+
from matplotlib_rs.figure import Figure
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class RendererTemplate(RendererBase):
|
|
41
|
+
"""
|
|
42
|
+
The renderer handles drawing/rendering operations.
|
|
43
|
+
|
|
44
|
+
This is a minimal do-nothing class that can be used to get started when
|
|
45
|
+
writing a new backend. Refer to `.backend_bases.RendererBase` for
|
|
46
|
+
documentation of the methods.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
def __init__(self, dpi):
|
|
50
|
+
super().__init__()
|
|
51
|
+
self.dpi = dpi
|
|
52
|
+
|
|
53
|
+
def draw_path(self, gc, path, transform, rgbFace=None):
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
# draw_markers is optional, and we get more correct relative
|
|
57
|
+
# timings by leaving it out. backend implementers concerned with
|
|
58
|
+
# performance will probably want to implement it
|
|
59
|
+
# def draw_markers(self, gc, marker_path, marker_trans, path, trans,
|
|
60
|
+
# rgbFace=None):
|
|
61
|
+
# pass
|
|
62
|
+
|
|
63
|
+
# draw_path_collection is optional, and we get more correct
|
|
64
|
+
# relative timings by leaving it out. backend implementers concerned with
|
|
65
|
+
# performance will probably want to implement it
|
|
66
|
+
# def draw_path_collection(self, gc, master_transform, paths,
|
|
67
|
+
# all_transforms, offsets, offset_trans,
|
|
68
|
+
# facecolors, edgecolors, linewidths, linestyles,
|
|
69
|
+
# antialiaseds):
|
|
70
|
+
# pass
|
|
71
|
+
|
|
72
|
+
# draw_quad_mesh is optional, and we get more correct
|
|
73
|
+
# relative timings by leaving it out. backend implementers concerned with
|
|
74
|
+
# performance will probably want to implement it
|
|
75
|
+
# def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight,
|
|
76
|
+
# coordinates, offsets, offsetTrans, facecolors,
|
|
77
|
+
# antialiased, edgecolors):
|
|
78
|
+
# pass
|
|
79
|
+
|
|
80
|
+
def draw_image(self, gc, x, y, im):
|
|
81
|
+
pass
|
|
82
|
+
|
|
83
|
+
def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
|
|
84
|
+
pass
|
|
85
|
+
|
|
86
|
+
def flipy(self):
|
|
87
|
+
# docstring inherited
|
|
88
|
+
return True
|
|
89
|
+
|
|
90
|
+
def get_canvas_width_height(self):
|
|
91
|
+
# docstring inherited
|
|
92
|
+
return 100, 100
|
|
93
|
+
|
|
94
|
+
def get_text_width_height_descent(self, s, prop, ismath):
|
|
95
|
+
return 1, 1, 1
|
|
96
|
+
|
|
97
|
+
def new_gc(self):
|
|
98
|
+
# docstring inherited
|
|
99
|
+
return GraphicsContextTemplate()
|
|
100
|
+
|
|
101
|
+
def points_to_pixels(self, points):
|
|
102
|
+
# if backend doesn't have dpi, e.g., postscript or svg
|
|
103
|
+
return points
|
|
104
|
+
# elif backend assumes a value for pixels_per_inch
|
|
105
|
+
# return points/72.0 * self.dpi.get() * pixels_per_inch/72.0
|
|
106
|
+
# else
|
|
107
|
+
# return points/72.0 * self.dpi.get()
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class GraphicsContextTemplate(GraphicsContextBase):
|
|
111
|
+
"""
|
|
112
|
+
The graphics context provides the color, line styles, etc. See the cairo
|
|
113
|
+
and postscript backends for examples of mapping the graphics context
|
|
114
|
+
attributes (cap styles, join styles, line widths, colors) to a particular
|
|
115
|
+
backend. In cairo this is done by wrapping a cairo.Context object and
|
|
116
|
+
forwarding the appropriate calls to it using a dictionary mapping styles
|
|
117
|
+
to gdk constants. In Postscript, all the work is done by the renderer,
|
|
118
|
+
mapping line styles to postscript calls.
|
|
119
|
+
|
|
120
|
+
If it's more appropriate to do the mapping at the renderer level (as in
|
|
121
|
+
the postscript backend), you don't need to override any of the GC methods.
|
|
122
|
+
If it's more appropriate to wrap an instance (as in the cairo backend) and
|
|
123
|
+
do the mapping here, you'll need to override several of the setter
|
|
124
|
+
methods.
|
|
125
|
+
|
|
126
|
+
The base GraphicsContext stores colors as an RGB tuple on the unit
|
|
127
|
+
interval, e.g., (0.5, 0.0, 1.0). You may need to map this to colors
|
|
128
|
+
appropriate for your backend.
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
########################################################################
|
|
133
|
+
#
|
|
134
|
+
# The following functions and classes are for pyplot and implement
|
|
135
|
+
# window/figure managers, etc.
|
|
136
|
+
#
|
|
137
|
+
########################################################################
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class FigureManagerTemplate(FigureManagerBase):
|
|
141
|
+
"""
|
|
142
|
+
Helper class for pyplot mode, wraps everything up into a neat bundle.
|
|
143
|
+
|
|
144
|
+
For non-interactive backends, the base class is sufficient. For
|
|
145
|
+
interactive backends, see the documentation of the `.FigureManagerBase`
|
|
146
|
+
class for the list of methods that can/should be overridden.
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class FigureCanvasTemplate(FigureCanvasBase):
|
|
151
|
+
"""
|
|
152
|
+
The canvas the figure renders into. Calls the draw and print fig
|
|
153
|
+
methods, creates the renderers, etc.
|
|
154
|
+
|
|
155
|
+
Note: GUI templates will want to connect events for button presses,
|
|
156
|
+
mouse movements and key presses to functions that call the base
|
|
157
|
+
class methods button_press_event, button_release_event,
|
|
158
|
+
motion_notify_event, key_press_event, and key_release_event. See the
|
|
159
|
+
implementations of the interactive backends for examples.
|
|
160
|
+
|
|
161
|
+
Attributes
|
|
162
|
+
----------
|
|
163
|
+
figure : `~matplotlib.figure.Figure`
|
|
164
|
+
A high-level Figure instance
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
# The instantiated manager class. For further customization,
|
|
168
|
+
# ``FigureManager.create_with_canvas`` can also be overridden; see the
|
|
169
|
+
# wx-based backends for an example.
|
|
170
|
+
manager_class = FigureManagerTemplate
|
|
171
|
+
|
|
172
|
+
def draw(self):
|
|
173
|
+
"""
|
|
174
|
+
Draw the figure using the renderer.
|
|
175
|
+
|
|
176
|
+
It is important that this method actually walk the artist tree
|
|
177
|
+
even if not output is produced because this will trigger
|
|
178
|
+
deferred work (like computing limits auto-limits and tick
|
|
179
|
+
values) that users may want access to before saving to disk.
|
|
180
|
+
"""
|
|
181
|
+
renderer = RendererTemplate(self.figure.dpi)
|
|
182
|
+
self.figure.draw(renderer)
|
|
183
|
+
|
|
184
|
+
# You should provide a print_xxx function for every file format
|
|
185
|
+
# you can write.
|
|
186
|
+
|
|
187
|
+
# If the file type is not in the base set of filetypes,
|
|
188
|
+
# you should add it to the class-scope filetypes dictionary as follows:
|
|
189
|
+
filetypes = {**FigureCanvasBase.filetypes, 'foo': 'My magic Foo format'}
|
|
190
|
+
|
|
191
|
+
def print_foo(self, filename, **kwargs):
|
|
192
|
+
"""
|
|
193
|
+
Write out format foo.
|
|
194
|
+
|
|
195
|
+
This method is normally called via `.Figure.savefig` and
|
|
196
|
+
`.FigureCanvasBase.print_figure`, which take care of setting the figure
|
|
197
|
+
facecolor, edgecolor, and dpi to the desired output values, and will
|
|
198
|
+
restore them to the original values. Therefore, `print_foo` does not
|
|
199
|
+
need to handle these settings.
|
|
200
|
+
"""
|
|
201
|
+
self.draw()
|
|
202
|
+
|
|
203
|
+
def get_default_filetype(self):
|
|
204
|
+
return 'foo'
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
########################################################################
|
|
208
|
+
#
|
|
209
|
+
# Now just provide the standard names that backend.__init__ is expecting
|
|
210
|
+
#
|
|
211
|
+
########################################################################
|
|
212
|
+
|
|
213
|
+
FigureCanvas = FigureCanvasTemplate
|
|
214
|
+
FigureManager = FigureManagerTemplate
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
from enum import Enum
|
|
3
|
+
import importlib
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
_RS_BACKENDS = {"agg"}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BackendFilter(Enum):
|
|
10
|
+
"""
|
|
11
|
+
Filter used with :meth:`~matplotlib.backends.registry.BackendRegistry.list_builtin`
|
|
12
|
+
|
|
13
|
+
.. versionadded:: 3.9
|
|
14
|
+
"""
|
|
15
|
+
INTERACTIVE = 0
|
|
16
|
+
NON_INTERACTIVE = 1
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class BackendRegistry:
|
|
20
|
+
"""
|
|
21
|
+
Registry of backends available within Matplotlib.
|
|
22
|
+
|
|
23
|
+
This is the single source of truth for available backends.
|
|
24
|
+
|
|
25
|
+
All use of ``BackendRegistry`` should be via the singleton instance
|
|
26
|
+
``backend_registry`` which can be imported from ``matplotlib.backends``.
|
|
27
|
+
|
|
28
|
+
Each backend has a name, a module name containing the backend code, and an
|
|
29
|
+
optional GUI framework that must be running if the backend is interactive.
|
|
30
|
+
There are three sources of backends: built-in (source code is within the
|
|
31
|
+
Matplotlib repository), explicit ``module://some.backend`` syntax (backend is
|
|
32
|
+
obtained by loading the module), or via an entry point (self-registering
|
|
33
|
+
backend in an external package).
|
|
34
|
+
|
|
35
|
+
.. versionadded:: 3.9
|
|
36
|
+
"""
|
|
37
|
+
# Mapping of built-in backend name to GUI framework, or "headless" for no
|
|
38
|
+
# GUI framework. Built-in backends are those which are included in the
|
|
39
|
+
# Matplotlib repo. A backend with name 'name' is located in the module
|
|
40
|
+
# f"matplotlib.backends.backend_{name.lower()}"
|
|
41
|
+
_BUILTIN_BACKEND_TO_GUI_FRAMEWORK = {
|
|
42
|
+
"gtk3agg": "gtk3",
|
|
43
|
+
"gtk3cairo": "gtk3",
|
|
44
|
+
"gtk4agg": "gtk4",
|
|
45
|
+
"gtk4cairo": "gtk4",
|
|
46
|
+
"macosx": "macosx",
|
|
47
|
+
"nbagg": "nbagg",
|
|
48
|
+
"notebook": "nbagg",
|
|
49
|
+
"qtagg": "qt",
|
|
50
|
+
"qtcairo": "qt",
|
|
51
|
+
"qt5agg": "qt5",
|
|
52
|
+
"qt5cairo": "qt5",
|
|
53
|
+
"tkagg": "tk",
|
|
54
|
+
"tkcairo": "tk",
|
|
55
|
+
"webagg": "webagg",
|
|
56
|
+
"wx": "wx",
|
|
57
|
+
"wxagg": "wx",
|
|
58
|
+
"wxcairo": "wx",
|
|
59
|
+
"agg": "headless",
|
|
60
|
+
"cairo": "headless",
|
|
61
|
+
"pdf": "headless",
|
|
62
|
+
"pgf": "headless",
|
|
63
|
+
"ps": "headless",
|
|
64
|
+
"svg": "headless",
|
|
65
|
+
"template": "headless",
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# Reverse mapping of gui framework to preferred built-in backend.
|
|
69
|
+
_GUI_FRAMEWORK_TO_BACKEND = {
|
|
70
|
+
"gtk3": "gtk3agg",
|
|
71
|
+
"gtk4": "gtk4agg",
|
|
72
|
+
"headless": "agg",
|
|
73
|
+
"macosx": "macosx",
|
|
74
|
+
"qt": "qtagg",
|
|
75
|
+
"qt5": "qt5agg",
|
|
76
|
+
"qt6": "qtagg",
|
|
77
|
+
"tk": "tkagg",
|
|
78
|
+
"wx": "wxagg",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
def __init__(self):
|
|
82
|
+
# Only load entry points when first needed.
|
|
83
|
+
self._loaded_entry_points = False
|
|
84
|
+
|
|
85
|
+
# Mapping of non-built-in backend to GUI framework, added dynamically from
|
|
86
|
+
# entry points and from matplotlib.use("module://some.backend") format.
|
|
87
|
+
# New entries have an "unknown" GUI framework that is determined when first
|
|
88
|
+
# needed by calling _get_gui_framework_by_loading.
|
|
89
|
+
self._backend_to_gui_framework = {}
|
|
90
|
+
|
|
91
|
+
# Mapping of backend name to module name, where different from
|
|
92
|
+
# f"matplotlib.backends.backend_{backend_name.lower()}". These are either
|
|
93
|
+
# hardcoded for backward compatibility, or loaded from entry points or
|
|
94
|
+
# "module://some.backend" syntax.
|
|
95
|
+
self._name_to_module = {
|
|
96
|
+
"notebook": "nbagg",
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
def _backend_module_name(self, backend):
|
|
100
|
+
if backend.startswith("module://"):
|
|
101
|
+
return backend[9:]
|
|
102
|
+
|
|
103
|
+
# Return name of module containing the specified backend.
|
|
104
|
+
# Does not check if the backend is valid, use is_valid_backend for that.
|
|
105
|
+
backend = backend.lower()
|
|
106
|
+
|
|
107
|
+
# Check if have specific name to module mapping.
|
|
108
|
+
backend = self._name_to_module.get(backend, backend)
|
|
109
|
+
|
|
110
|
+
if backend.startswith("module://"):
|
|
111
|
+
return backend[9:]
|
|
112
|
+
# matplotlib_rs renders with its Rust Agg port; interactive and
|
|
113
|
+
# vector backends fall back to it.
|
|
114
|
+
if backend in _RS_BACKENDS:
|
|
115
|
+
return f"{__package__}.backend_{backend}"
|
|
116
|
+
return f"{__package__}.backend_agg"
|
|
117
|
+
|
|
118
|
+
def _clear(self):
|
|
119
|
+
# Clear all dynamically-added data, used for testing only.
|
|
120
|
+
self.__init__()
|
|
121
|
+
|
|
122
|
+
def _ensure_entry_points_loaded(self):
|
|
123
|
+
# Load entry points, if they have not already been loaded.
|
|
124
|
+
if not self._loaded_entry_points:
|
|
125
|
+
entries = self._read_entry_points()
|
|
126
|
+
self._validate_and_store_entry_points(entries)
|
|
127
|
+
self._loaded_entry_points = True
|
|
128
|
+
|
|
129
|
+
def _get_gui_framework_by_loading(self, backend):
|
|
130
|
+
# Determine GUI framework for a backend by loading its module and reading the
|
|
131
|
+
# FigureCanvas.required_interactive_framework attribute.
|
|
132
|
+
# Returns "headless" if there is no GUI framework.
|
|
133
|
+
module = self.load_backend_module(backend)
|
|
134
|
+
canvas_class = module.FigureCanvas
|
|
135
|
+
return canvas_class.required_interactive_framework or "headless"
|
|
136
|
+
|
|
137
|
+
def _read_entry_points(self):
|
|
138
|
+
# Read entry points of modules that self-advertise as Matplotlib backends.
|
|
139
|
+
# Expects entry points like this one from matplotlib-inline (in pyproject.toml
|
|
140
|
+
# format):
|
|
141
|
+
# [project.entry-points."matplotlib.backend"]
|
|
142
|
+
# inline = "matplotlib_inline.backend_inline"
|
|
143
|
+
import importlib.metadata as im
|
|
144
|
+
|
|
145
|
+
entry_points = im.entry_points(group="matplotlib.backend")
|
|
146
|
+
entries = [(entry.name, entry.value) for entry in entry_points]
|
|
147
|
+
|
|
148
|
+
# For backward compatibility, if matplotlib-inline and/or ipympl are installed
|
|
149
|
+
# but too old to include entry points, create them. Do not import ipympl
|
|
150
|
+
# directly as this calls matplotlib.use() whilst in this function.
|
|
151
|
+
def backward_compatible_entry_points(
|
|
152
|
+
entries, module_name, threshold_version, names, target):
|
|
153
|
+
from matplotlib_rs import _parse_to_version_info
|
|
154
|
+
try:
|
|
155
|
+
module_version = im.version(module_name)
|
|
156
|
+
if _parse_to_version_info(module_version) < threshold_version:
|
|
157
|
+
for name in names:
|
|
158
|
+
entries.append((name, target))
|
|
159
|
+
except im.PackageNotFoundError:
|
|
160
|
+
pass
|
|
161
|
+
|
|
162
|
+
names = [entry[0] for entry in entries]
|
|
163
|
+
if "inline" not in names:
|
|
164
|
+
backward_compatible_entry_points(
|
|
165
|
+
entries, "matplotlib_inline", (0, 1, 7), ["inline"],
|
|
166
|
+
"matplotlib_inline.backend_inline")
|
|
167
|
+
if "ipympl" not in names:
|
|
168
|
+
backward_compatible_entry_points(
|
|
169
|
+
entries, "ipympl", (0, 9, 4), ["ipympl", "widget"],
|
|
170
|
+
"ipympl.backend_nbagg")
|
|
171
|
+
|
|
172
|
+
return entries
|
|
173
|
+
|
|
174
|
+
def _validate_and_store_entry_points(self, entries):
|
|
175
|
+
# Validate and store entry points so that they can be used via matplotlib.use()
|
|
176
|
+
# in the normal manner. Entry point names cannot be of module:// format, cannot
|
|
177
|
+
# shadow a built-in backend name, and there cannot be multiple entry points
|
|
178
|
+
# with the same name but different modules. Multiple entry points with the same
|
|
179
|
+
# name and value are permitted (it can sometimes happen outside of our control,
|
|
180
|
+
# see https://github.com/matplotlib/matplotlib/issues/28367).
|
|
181
|
+
for name, module in set(entries):
|
|
182
|
+
name = name.lower()
|
|
183
|
+
if name.startswith("module://"):
|
|
184
|
+
raise RuntimeError(
|
|
185
|
+
f"Entry point name '{name}' cannot start with 'module://'")
|
|
186
|
+
if name in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK:
|
|
187
|
+
raise RuntimeError(f"Entry point name '{name}' is a built-in backend")
|
|
188
|
+
if name in self._backend_to_gui_framework:
|
|
189
|
+
raise RuntimeError(f"Entry point name '{name}' duplicated")
|
|
190
|
+
|
|
191
|
+
self._name_to_module[name] = "module://" + module
|
|
192
|
+
# Do not yet know backend GUI framework, determine it only when necessary.
|
|
193
|
+
self._backend_to_gui_framework[name] = "unknown"
|
|
194
|
+
|
|
195
|
+
def backend_for_gui_framework(self, framework):
|
|
196
|
+
"""
|
|
197
|
+
Return the name of the backend corresponding to the specified GUI framework.
|
|
198
|
+
|
|
199
|
+
Parameters
|
|
200
|
+
----------
|
|
201
|
+
framework : str
|
|
202
|
+
GUI framework such as "qt".
|
|
203
|
+
|
|
204
|
+
Returns
|
|
205
|
+
-------
|
|
206
|
+
str or None
|
|
207
|
+
Backend name or None if GUI framework not recognised.
|
|
208
|
+
"""
|
|
209
|
+
return self._GUI_FRAMEWORK_TO_BACKEND.get(framework.lower())
|
|
210
|
+
|
|
211
|
+
def is_valid_backend(self, backend):
|
|
212
|
+
"""
|
|
213
|
+
Return True if the backend name is valid, False otherwise.
|
|
214
|
+
|
|
215
|
+
A backend name is valid if it is one of the built-in backends or has been
|
|
216
|
+
dynamically added via an entry point. Those beginning with ``module://`` are
|
|
217
|
+
always considered valid and are added to the current list of all backends
|
|
218
|
+
within this function.
|
|
219
|
+
|
|
220
|
+
Even if a name is valid, it may not be importable or usable. This can only be
|
|
221
|
+
determined by loading and using the backend module.
|
|
222
|
+
|
|
223
|
+
Parameters
|
|
224
|
+
----------
|
|
225
|
+
backend : str
|
|
226
|
+
Name of backend.
|
|
227
|
+
|
|
228
|
+
Returns
|
|
229
|
+
-------
|
|
230
|
+
bool
|
|
231
|
+
True if backend is valid, False otherwise.
|
|
232
|
+
"""
|
|
233
|
+
if not backend.startswith("module://"):
|
|
234
|
+
backend = backend.lower()
|
|
235
|
+
|
|
236
|
+
# For backward compatibility, convert ipympl and matplotlib-inline long
|
|
237
|
+
# module:// names to their shortened forms.
|
|
238
|
+
backwards_compat = {
|
|
239
|
+
"module://ipympl.backend_nbagg": "widget",
|
|
240
|
+
"module://matplotlib_inline.backend_inline": "inline",
|
|
241
|
+
}
|
|
242
|
+
backend = backwards_compat.get(backend, backend)
|
|
243
|
+
|
|
244
|
+
if (backend in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK or
|
|
245
|
+
backend in self._backend_to_gui_framework):
|
|
246
|
+
return True
|
|
247
|
+
|
|
248
|
+
if backend.startswith("module://"):
|
|
249
|
+
self._backend_to_gui_framework[backend] = "unknown"
|
|
250
|
+
return True
|
|
251
|
+
|
|
252
|
+
# Only load entry points if really need to and not already done so.
|
|
253
|
+
self._ensure_entry_points_loaded()
|
|
254
|
+
if backend in self._backend_to_gui_framework:
|
|
255
|
+
return True
|
|
256
|
+
|
|
257
|
+
return False
|
|
258
|
+
|
|
259
|
+
def list_all(self):
|
|
260
|
+
"""
|
|
261
|
+
Return list of all known backends.
|
|
262
|
+
|
|
263
|
+
These include built-in backends and those obtained at runtime either from entry
|
|
264
|
+
points or explicit ``module://some.backend`` syntax.
|
|
265
|
+
|
|
266
|
+
Entry points will be loaded if they haven't been already.
|
|
267
|
+
|
|
268
|
+
Returns
|
|
269
|
+
-------
|
|
270
|
+
list of str
|
|
271
|
+
Backend names.
|
|
272
|
+
"""
|
|
273
|
+
self._ensure_entry_points_loaded()
|
|
274
|
+
return [*self.list_builtin(), *self._backend_to_gui_framework]
|
|
275
|
+
|
|
276
|
+
def list_builtin(self, filter_=None):
|
|
277
|
+
"""
|
|
278
|
+
Return list of backends that are built into Matplotlib.
|
|
279
|
+
|
|
280
|
+
Parameters
|
|
281
|
+
----------
|
|
282
|
+
filter_ : `~.BackendFilter`, optional
|
|
283
|
+
Filter to apply to returned backends. For example, to return only
|
|
284
|
+
non-interactive backends use `.BackendFilter.NON_INTERACTIVE`.
|
|
285
|
+
|
|
286
|
+
Returns
|
|
287
|
+
-------
|
|
288
|
+
list of str
|
|
289
|
+
Backend names.
|
|
290
|
+
"""
|
|
291
|
+
if filter_ == BackendFilter.INTERACTIVE:
|
|
292
|
+
return [k for k, v in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK.items()
|
|
293
|
+
if v != "headless"]
|
|
294
|
+
elif filter_ == BackendFilter.NON_INTERACTIVE:
|
|
295
|
+
return [k for k, v in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK.items()
|
|
296
|
+
if v == "headless"]
|
|
297
|
+
|
|
298
|
+
return [*self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK]
|
|
299
|
+
|
|
300
|
+
def list_gui_frameworks(self):
|
|
301
|
+
"""
|
|
302
|
+
Return list of GUI frameworks used by Matplotlib backends.
|
|
303
|
+
|
|
304
|
+
Returns
|
|
305
|
+
-------
|
|
306
|
+
list of str
|
|
307
|
+
GUI framework names.
|
|
308
|
+
"""
|
|
309
|
+
return [k for k in self._GUI_FRAMEWORK_TO_BACKEND if k != "headless"]
|
|
310
|
+
|
|
311
|
+
def load_backend_module(self, backend):
|
|
312
|
+
"""
|
|
313
|
+
Load and return the module containing the specified backend.
|
|
314
|
+
|
|
315
|
+
Parameters
|
|
316
|
+
----------
|
|
317
|
+
backend : str
|
|
318
|
+
Name of backend to load.
|
|
319
|
+
|
|
320
|
+
Returns
|
|
321
|
+
-------
|
|
322
|
+
Module
|
|
323
|
+
Module containing backend.
|
|
324
|
+
"""
|
|
325
|
+
module_name = self._backend_module_name(backend)
|
|
326
|
+
return importlib.import_module(module_name)
|
|
327
|
+
|
|
328
|
+
def resolve_backend(self, backend):
|
|
329
|
+
"""
|
|
330
|
+
Return the backend and GUI framework for the specified backend name.
|
|
331
|
+
|
|
332
|
+
If the GUI framework is not yet known then it will be determined by loading the
|
|
333
|
+
backend module and checking the ``FigureCanvas.required_interactive_framework``
|
|
334
|
+
attribute.
|
|
335
|
+
|
|
336
|
+
This function only loads entry points if they have not already been loaded and
|
|
337
|
+
the backend is not built-in and not of ``module://some.backend`` format.
|
|
338
|
+
|
|
339
|
+
Parameters
|
|
340
|
+
----------
|
|
341
|
+
backend : str or None
|
|
342
|
+
Name of backend, or None to use the default backend.
|
|
343
|
+
|
|
344
|
+
Returns
|
|
345
|
+
-------
|
|
346
|
+
backend : str
|
|
347
|
+
The backend name.
|
|
348
|
+
framework : str or None
|
|
349
|
+
The GUI framework, which will be None for a backend that is non-interactive.
|
|
350
|
+
"""
|
|
351
|
+
if isinstance(backend, str):
|
|
352
|
+
if not backend.startswith("module://"):
|
|
353
|
+
backend = backend.lower()
|
|
354
|
+
else: # Might be _auto_backend_sentinel or None
|
|
355
|
+
# Use whatever is already running...
|
|
356
|
+
from matplotlib_rs import get_backend
|
|
357
|
+
backend = get_backend()
|
|
358
|
+
|
|
359
|
+
# Is backend already known (built-in or dynamically loaded)?
|
|
360
|
+
gui = (self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK.get(backend) or
|
|
361
|
+
self._backend_to_gui_framework.get(backend))
|
|
362
|
+
|
|
363
|
+
# Is backend "module://something"?
|
|
364
|
+
if gui is None and isinstance(backend, str) and backend.startswith("module://"):
|
|
365
|
+
gui = "unknown"
|
|
366
|
+
|
|
367
|
+
# Is backend a possible entry point?
|
|
368
|
+
if gui is None and not self._loaded_entry_points:
|
|
369
|
+
self._ensure_entry_points_loaded()
|
|
370
|
+
gui = self._backend_to_gui_framework.get(backend)
|
|
371
|
+
|
|
372
|
+
# Backend known but not its gui framework.
|
|
373
|
+
if gui == "unknown":
|
|
374
|
+
gui = self._get_gui_framework_by_loading(backend)
|
|
375
|
+
self._backend_to_gui_framework[backend] = gui
|
|
376
|
+
|
|
377
|
+
if gui is None:
|
|
378
|
+
raise RuntimeError(f"'{backend}' is not a recognised backend name")
|
|
379
|
+
|
|
380
|
+
return backend, gui if gui != "headless" else None
|
|
381
|
+
|
|
382
|
+
def resolve_gui_or_backend(self, gui_or_backend):
|
|
383
|
+
"""
|
|
384
|
+
Return the backend and GUI framework for the specified string that may be
|
|
385
|
+
either a GUI framework or a backend name, tested in that order.
|
|
386
|
+
|
|
387
|
+
This is for use with the IPython %matplotlib magic command which may be a GUI
|
|
388
|
+
framework such as ``%matplotlib qt`` or a backend name such as
|
|
389
|
+
``%matplotlib qtagg``.
|
|
390
|
+
|
|
391
|
+
This function only loads entry points if they have not already been loaded and
|
|
392
|
+
the backend is not built-in and not of ``module://some.backend`` format.
|
|
393
|
+
|
|
394
|
+
Parameters
|
|
395
|
+
----------
|
|
396
|
+
gui_or_backend : str or None
|
|
397
|
+
Name of GUI framework or backend, or None to use the default backend.
|
|
398
|
+
|
|
399
|
+
Returns
|
|
400
|
+
-------
|
|
401
|
+
backend : str
|
|
402
|
+
The backend name.
|
|
403
|
+
framework : str or None
|
|
404
|
+
The GUI framework, which will be None for a backend that is non-interactive.
|
|
405
|
+
"""
|
|
406
|
+
if not gui_or_backend.startswith("module://"):
|
|
407
|
+
gui_or_backend = gui_or_backend.lower()
|
|
408
|
+
|
|
409
|
+
# First check if it is a gui loop name.
|
|
410
|
+
backend = self.backend_for_gui_framework(gui_or_backend)
|
|
411
|
+
if backend is not None:
|
|
412
|
+
return backend, gui_or_backend if gui_or_backend != "headless" else None
|
|
413
|
+
|
|
414
|
+
# Then check if it is a backend name.
|
|
415
|
+
try:
|
|
416
|
+
return self.resolve_backend(gui_or_backend)
|
|
417
|
+
except Exception: # KeyError ?
|
|
418
|
+
raise RuntimeError(
|
|
419
|
+
f"'{gui_or_backend}' is not a recognised GUI loop or backend name")
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
# Singleton
|
|
423
|
+
backend_registry = BackendRegistry()
|