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
matplotlib_rs/markers.py
ADDED
|
@@ -0,0 +1,908 @@
|
|
|
1
|
+
# Vendored from matplotlib 3.11 (see licenses/LICENSE_MATPLOTLIB), adapted for matplotlib_rs.
|
|
2
|
+
r"""
|
|
3
|
+
Functions to handle markers; used by the marker functionality of
|
|
4
|
+
`~matplotlib.axes.Axes.plot`, `~matplotlib.axes.Axes.scatter`, and
|
|
5
|
+
`~matplotlib.axes.Axes.errorbar`.
|
|
6
|
+
|
|
7
|
+
All possible markers are defined here:
|
|
8
|
+
|
|
9
|
+
============================== ====== =========================================
|
|
10
|
+
marker symbol description
|
|
11
|
+
============================== ====== =========================================
|
|
12
|
+
``"."`` |m00| point
|
|
13
|
+
``","`` |m01| pixel
|
|
14
|
+
``"o"`` |m02| circle
|
|
15
|
+
``"v"`` |m03| triangle_down
|
|
16
|
+
``"^"`` |m04| triangle_up
|
|
17
|
+
``"<"`` |m05| triangle_left
|
|
18
|
+
``">"`` |m06| triangle_right
|
|
19
|
+
``"1"`` |m07| tri_down
|
|
20
|
+
``"2"`` |m08| tri_up
|
|
21
|
+
``"3"`` |m09| tri_left
|
|
22
|
+
``"4"`` |m10| tri_right
|
|
23
|
+
``"8"`` |m11| octagon
|
|
24
|
+
``"s"`` |m12| square
|
|
25
|
+
``"p"`` |m13| pentagon
|
|
26
|
+
``"P"`` |m23| plus (filled)
|
|
27
|
+
``"*"`` |m14| star
|
|
28
|
+
``"h"`` |m15| hexagon1
|
|
29
|
+
``"H"`` |m16| hexagon2
|
|
30
|
+
``"+"`` |m17| plus
|
|
31
|
+
``"x"`` |m18| x
|
|
32
|
+
``"X"`` |m24| x (filled)
|
|
33
|
+
``"D"`` |m19| diamond
|
|
34
|
+
``"d"`` |m20| thin_diamond
|
|
35
|
+
``"|"`` |m21| vline
|
|
36
|
+
``"_"`` |m22| hline
|
|
37
|
+
``0`` (``TICKLEFT``) |m25| tickleft
|
|
38
|
+
``1`` (``TICKRIGHT``) |m26| tickright
|
|
39
|
+
``2`` (``TICKUP``) |m27| tickup
|
|
40
|
+
``3`` (``TICKDOWN``) |m28| tickdown
|
|
41
|
+
``4`` (``CARETLEFT``) |m29| caretleft
|
|
42
|
+
``5`` (``CARETRIGHT``) |m30| caretright
|
|
43
|
+
``6`` (``CARETUP``) |m31| caretup
|
|
44
|
+
``7`` (``CARETDOWN``) |m32| caretdown
|
|
45
|
+
``8`` (``CARETLEFTBASE``) |m33| caretleft (centered at base)
|
|
46
|
+
``9`` (``CARETRIGHTBASE``) |m34| caretright (centered at base)
|
|
47
|
+
``10`` (``CARETUPBASE``) |m35| caretup (centered at base)
|
|
48
|
+
``11`` (``CARETDOWNBASE``) |m36| caretdown (centered at base)
|
|
49
|
+
``"none"`` or ``"None"`` nothing
|
|
50
|
+
``" "`` or ``""`` nothing
|
|
51
|
+
``"$...$"`` |m37| Render the string using mathtext.
|
|
52
|
+
E.g ``"$f$"`` for marker showing the
|
|
53
|
+
letter ``f``.
|
|
54
|
+
``verts`` A list of (x, y) pairs used for Path
|
|
55
|
+
vertices. The center of the marker is
|
|
56
|
+
located at (0, 0) and the size is
|
|
57
|
+
normalized, such that the created path
|
|
58
|
+
is encapsulated inside the unit cell.
|
|
59
|
+
``path`` A `~matplotlib.path.Path` instance.
|
|
60
|
+
``(numsides, 0, angle)`` A regular polygon with ``numsides``
|
|
61
|
+
sides, rotated by ``angle``.
|
|
62
|
+
``(numsides, 1, angle)`` A star-like symbol with ``numsides``
|
|
63
|
+
sides, rotated by ``angle``.
|
|
64
|
+
``(numsides, 2, angle)`` An asterisk with ``numsides`` sides,
|
|
65
|
+
rotated by ``angle``.
|
|
66
|
+
============================== ====== =========================================
|
|
67
|
+
|
|
68
|
+
Note that special symbols can be defined via the
|
|
69
|
+
:ref:`STIX math font <mathtext>`,
|
|
70
|
+
e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer to the
|
|
71
|
+
`STIX font table <http://www.stixfonts.org/allGlyphs.html>`_.
|
|
72
|
+
Also see the :doc:`/gallery/text_labels_and_annotations/stix_fonts_demo`.
|
|
73
|
+
|
|
74
|
+
Integer numbers from ``0`` to ``11`` create lines and triangles. Those are
|
|
75
|
+
equally accessible via capitalized variables, like ``CARETDOWNBASE``.
|
|
76
|
+
Hence the following are equivalent::
|
|
77
|
+
|
|
78
|
+
plt.plot([1, 2, 3], marker=11)
|
|
79
|
+
plt.plot([1, 2, 3], marker=matplotlib.markers.CARETDOWNBASE)
|
|
80
|
+
|
|
81
|
+
Markers join and cap styles can be customized by creating a new instance of
|
|
82
|
+
MarkerStyle.
|
|
83
|
+
A MarkerStyle can also have a custom `~matplotlib.transforms.Transform`
|
|
84
|
+
allowing it to be arbitrarily rotated or offset.
|
|
85
|
+
|
|
86
|
+
Examples showing the use of markers:
|
|
87
|
+
|
|
88
|
+
* :doc:`/gallery/lines_bars_and_markers/marker_reference`
|
|
89
|
+
* :doc:`/gallery/lines_bars_and_markers/scatter_star_poly`
|
|
90
|
+
* :doc:`/gallery/lines_bars_and_markers/multivariate_marker_plot`
|
|
91
|
+
|
|
92
|
+
.. |m00| image:: /_static/markers/m00.png
|
|
93
|
+
.. |m01| image:: /_static/markers/m01.png
|
|
94
|
+
.. |m02| image:: /_static/markers/m02.png
|
|
95
|
+
.. |m03| image:: /_static/markers/m03.png
|
|
96
|
+
.. |m04| image:: /_static/markers/m04.png
|
|
97
|
+
.. |m05| image:: /_static/markers/m05.png
|
|
98
|
+
.. |m06| image:: /_static/markers/m06.png
|
|
99
|
+
.. |m07| image:: /_static/markers/m07.png
|
|
100
|
+
.. |m08| image:: /_static/markers/m08.png
|
|
101
|
+
.. |m09| image:: /_static/markers/m09.png
|
|
102
|
+
.. |m10| image:: /_static/markers/m10.png
|
|
103
|
+
.. |m11| image:: /_static/markers/m11.png
|
|
104
|
+
.. |m12| image:: /_static/markers/m12.png
|
|
105
|
+
.. |m13| image:: /_static/markers/m13.png
|
|
106
|
+
.. |m14| image:: /_static/markers/m14.png
|
|
107
|
+
.. |m15| image:: /_static/markers/m15.png
|
|
108
|
+
.. |m16| image:: /_static/markers/m16.png
|
|
109
|
+
.. |m17| image:: /_static/markers/m17.png
|
|
110
|
+
.. |m18| image:: /_static/markers/m18.png
|
|
111
|
+
.. |m19| image:: /_static/markers/m19.png
|
|
112
|
+
.. |m20| image:: /_static/markers/m20.png
|
|
113
|
+
.. |m21| image:: /_static/markers/m21.png
|
|
114
|
+
.. |m22| image:: /_static/markers/m22.png
|
|
115
|
+
.. |m23| image:: /_static/markers/m23.png
|
|
116
|
+
.. |m24| image:: /_static/markers/m24.png
|
|
117
|
+
.. |m25| image:: /_static/markers/m25.png
|
|
118
|
+
.. |m26| image:: /_static/markers/m26.png
|
|
119
|
+
.. |m27| image:: /_static/markers/m27.png
|
|
120
|
+
.. |m28| image:: /_static/markers/m28.png
|
|
121
|
+
.. |m29| image:: /_static/markers/m29.png
|
|
122
|
+
.. |m30| image:: /_static/markers/m30.png
|
|
123
|
+
.. |m31| image:: /_static/markers/m31.png
|
|
124
|
+
.. |m32| image:: /_static/markers/m32.png
|
|
125
|
+
.. |m33| image:: /_static/markers/m33.png
|
|
126
|
+
.. |m34| image:: /_static/markers/m34.png
|
|
127
|
+
.. |m35| image:: /_static/markers/m35.png
|
|
128
|
+
.. |m36| image:: /_static/markers/m36.png
|
|
129
|
+
.. |m37| image:: /_static/markers/m37.png
|
|
130
|
+
"""
|
|
131
|
+
import copy
|
|
132
|
+
|
|
133
|
+
from collections.abc import Hashable, Sized
|
|
134
|
+
|
|
135
|
+
import numpy as np
|
|
136
|
+
|
|
137
|
+
import matplotlib_rs as mpl
|
|
138
|
+
from . import _api, cbook
|
|
139
|
+
from .path import Path
|
|
140
|
+
from .transforms import IdentityTransform, Affine2D
|
|
141
|
+
from ._enums import JoinStyle, CapStyle
|
|
142
|
+
|
|
143
|
+
# special-purpose marker identifiers:
|
|
144
|
+
(TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN,
|
|
145
|
+
CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN,
|
|
146
|
+
CARETLEFTBASE, CARETRIGHTBASE, CARETUPBASE, CARETDOWNBASE) = range(12)
|
|
147
|
+
|
|
148
|
+
_empty_path = Path(np.empty((0, 2)))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class MarkerStyle:
|
|
152
|
+
"""
|
|
153
|
+
A class representing marker types.
|
|
154
|
+
|
|
155
|
+
Instances are immutable. If you need to change anything, create a new
|
|
156
|
+
instance.
|
|
157
|
+
|
|
158
|
+
Attributes
|
|
159
|
+
----------
|
|
160
|
+
markers : dict
|
|
161
|
+
All known markers.
|
|
162
|
+
filled_markers : tuple
|
|
163
|
+
All known filled markers. This is a subset of *markers*.
|
|
164
|
+
fillstyles : tuple
|
|
165
|
+
The supported fillstyles.
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
markers = {
|
|
169
|
+
'.': 'point',
|
|
170
|
+
',': 'pixel',
|
|
171
|
+
'o': 'circle',
|
|
172
|
+
'v': 'triangle_down',
|
|
173
|
+
'^': 'triangle_up',
|
|
174
|
+
'<': 'triangle_left',
|
|
175
|
+
'>': 'triangle_right',
|
|
176
|
+
'1': 'tri_down',
|
|
177
|
+
'2': 'tri_up',
|
|
178
|
+
'3': 'tri_left',
|
|
179
|
+
'4': 'tri_right',
|
|
180
|
+
'8': 'octagon',
|
|
181
|
+
's': 'square',
|
|
182
|
+
'p': 'pentagon',
|
|
183
|
+
'*': 'star',
|
|
184
|
+
'h': 'hexagon1',
|
|
185
|
+
'H': 'hexagon2',
|
|
186
|
+
'+': 'plus',
|
|
187
|
+
'x': 'x',
|
|
188
|
+
'D': 'diamond',
|
|
189
|
+
'd': 'thin_diamond',
|
|
190
|
+
'|': 'vline',
|
|
191
|
+
'_': 'hline',
|
|
192
|
+
'P': 'plus_filled',
|
|
193
|
+
'X': 'x_filled',
|
|
194
|
+
TICKLEFT: 'tickleft',
|
|
195
|
+
TICKRIGHT: 'tickright',
|
|
196
|
+
TICKUP: 'tickup',
|
|
197
|
+
TICKDOWN: 'tickdown',
|
|
198
|
+
CARETLEFT: 'caretleft',
|
|
199
|
+
CARETRIGHT: 'caretright',
|
|
200
|
+
CARETUP: 'caretup',
|
|
201
|
+
CARETDOWN: 'caretdown',
|
|
202
|
+
CARETLEFTBASE: 'caretleftbase',
|
|
203
|
+
CARETRIGHTBASE: 'caretrightbase',
|
|
204
|
+
CARETUPBASE: 'caretupbase',
|
|
205
|
+
CARETDOWNBASE: 'caretdownbase',
|
|
206
|
+
"None": 'nothing',
|
|
207
|
+
"none": 'nothing',
|
|
208
|
+
' ': 'nothing',
|
|
209
|
+
'': 'nothing'
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
# Just used for informational purposes. is_filled()
|
|
213
|
+
# is calculated in the _set_* functions.
|
|
214
|
+
filled_markers = (
|
|
215
|
+
'.', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd',
|
|
216
|
+
'P', 'X')
|
|
217
|
+
|
|
218
|
+
fillstyles = ('full', 'left', 'right', 'bottom', 'top', 'none')
|
|
219
|
+
_half_fillstyles = ('left', 'right', 'bottom', 'top')
|
|
220
|
+
|
|
221
|
+
def __init__(self, marker,
|
|
222
|
+
fillstyle=None, transform=None, capstyle=None, joinstyle=None):
|
|
223
|
+
"""
|
|
224
|
+
Parameters
|
|
225
|
+
----------
|
|
226
|
+
marker : str, array-like, Path, MarkerStyle
|
|
227
|
+
- Another instance of `MarkerStyle` copies the details of that *marker*.
|
|
228
|
+
- For other possible marker values, see the module docstring
|
|
229
|
+
`matplotlib.markers`.
|
|
230
|
+
|
|
231
|
+
fillstyle : str, default: :rc:`markers.fillstyle`
|
|
232
|
+
One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
|
|
233
|
+
|
|
234
|
+
transform : `~matplotlib.transforms.Transform`, optional
|
|
235
|
+
Transform that will be combined with the native transform of the
|
|
236
|
+
marker.
|
|
237
|
+
|
|
238
|
+
capstyle : `.CapStyle` or %(CapStyle)s, optional
|
|
239
|
+
Cap style that will override the default cap style of the marker.
|
|
240
|
+
|
|
241
|
+
joinstyle : `.JoinStyle` or %(JoinStyle)s, optional
|
|
242
|
+
Join style that will override the default join style of the marker.
|
|
243
|
+
"""
|
|
244
|
+
self._marker_function = None
|
|
245
|
+
self._user_transform = transform
|
|
246
|
+
self._user_capstyle = CapStyle(capstyle) if capstyle is not None else None
|
|
247
|
+
self._user_joinstyle = JoinStyle(joinstyle) if joinstyle is not None else None
|
|
248
|
+
self._set_fillstyle(fillstyle)
|
|
249
|
+
self._set_marker(marker)
|
|
250
|
+
|
|
251
|
+
def _recache(self):
|
|
252
|
+
if self._marker_function is None:
|
|
253
|
+
return
|
|
254
|
+
self._path = _empty_path
|
|
255
|
+
self._transform = IdentityTransform()
|
|
256
|
+
self._alt_path = None
|
|
257
|
+
self._alt_transform = None
|
|
258
|
+
self._snap_threshold = None
|
|
259
|
+
self._joinstyle = JoinStyle.round
|
|
260
|
+
self._capstyle = self._user_capstyle or CapStyle.butt
|
|
261
|
+
# Initial guess: Assume the marker is filled unless the fillstyle is
|
|
262
|
+
# set to 'none'. The marker function will override this for unfilled
|
|
263
|
+
# markers.
|
|
264
|
+
self._filled = self._fillstyle != 'none'
|
|
265
|
+
self._marker_function()
|
|
266
|
+
|
|
267
|
+
def __bool__(self):
|
|
268
|
+
return bool(len(self._path.vertices))
|
|
269
|
+
|
|
270
|
+
def is_filled(self):
|
|
271
|
+
return self._filled
|
|
272
|
+
|
|
273
|
+
def get_fillstyle(self):
|
|
274
|
+
return self._fillstyle
|
|
275
|
+
|
|
276
|
+
def _set_fillstyle(self, fillstyle):
|
|
277
|
+
"""
|
|
278
|
+
Set the fillstyle.
|
|
279
|
+
|
|
280
|
+
Parameters
|
|
281
|
+
----------
|
|
282
|
+
fillstyle : {'full', 'left', 'right', 'bottom', 'top', 'none'}
|
|
283
|
+
The part of the marker surface that is colored with
|
|
284
|
+
markerfacecolor.
|
|
285
|
+
"""
|
|
286
|
+
fillstyle = mpl._val_or_rc(fillstyle, 'markers.fillstyle')
|
|
287
|
+
_api.check_in_list(self.fillstyles, fillstyle=fillstyle)
|
|
288
|
+
self._fillstyle = fillstyle
|
|
289
|
+
|
|
290
|
+
def get_joinstyle(self):
|
|
291
|
+
return self._joinstyle.name
|
|
292
|
+
|
|
293
|
+
def get_capstyle(self):
|
|
294
|
+
return self._capstyle.name
|
|
295
|
+
|
|
296
|
+
def get_marker(self):
|
|
297
|
+
return self._marker
|
|
298
|
+
|
|
299
|
+
def _set_marker(self, marker):
|
|
300
|
+
"""
|
|
301
|
+
Set the marker.
|
|
302
|
+
|
|
303
|
+
Parameters
|
|
304
|
+
----------
|
|
305
|
+
marker : str, array-like, Path, MarkerStyle
|
|
306
|
+
- Another instance of `MarkerStyle` copies the details of that *marker*.
|
|
307
|
+
- For other possible marker values see the module docstring
|
|
308
|
+
`matplotlib.markers`.
|
|
309
|
+
"""
|
|
310
|
+
if isinstance(marker, str) and cbook.is_math_text(marker):
|
|
311
|
+
self._marker_function = self._set_mathtext_path
|
|
312
|
+
elif isinstance(marker, Hashable) and marker in self.markers:
|
|
313
|
+
self._marker_function = getattr(self, '_set_' + self.markers[marker])
|
|
314
|
+
elif (isinstance(marker, np.ndarray) and marker.ndim == 2 and
|
|
315
|
+
marker.shape[1] == 2):
|
|
316
|
+
self._marker_function = self._set_vertices
|
|
317
|
+
elif isinstance(marker, Path):
|
|
318
|
+
self._marker_function = self._set_path_marker
|
|
319
|
+
elif (isinstance(marker, Sized) and len(marker) in (2, 3) and
|
|
320
|
+
marker[1] in (0, 1, 2)):
|
|
321
|
+
self._marker_function = self._set_tuple_marker
|
|
322
|
+
elif isinstance(marker, MarkerStyle):
|
|
323
|
+
self.__dict__ = copy.deepcopy(marker.__dict__)
|
|
324
|
+
else:
|
|
325
|
+
try:
|
|
326
|
+
Path(marker)
|
|
327
|
+
self._marker_function = self._set_vertices
|
|
328
|
+
except ValueError as err:
|
|
329
|
+
raise ValueError(
|
|
330
|
+
f'Unrecognized marker style {marker!r}') from err
|
|
331
|
+
|
|
332
|
+
if not isinstance(marker, MarkerStyle):
|
|
333
|
+
self._marker = marker
|
|
334
|
+
self._recache()
|
|
335
|
+
|
|
336
|
+
def get_path(self):
|
|
337
|
+
"""
|
|
338
|
+
Return a `.Path` for the primary part of the marker.
|
|
339
|
+
|
|
340
|
+
For unfilled markers this is the whole marker, for filled markers,
|
|
341
|
+
this is the area to be drawn with *markerfacecolor*.
|
|
342
|
+
"""
|
|
343
|
+
return self._path
|
|
344
|
+
|
|
345
|
+
def get_transform(self):
|
|
346
|
+
"""
|
|
347
|
+
Return the transform to be applied to the `.Path` from
|
|
348
|
+
`MarkerStyle.get_path()`.
|
|
349
|
+
"""
|
|
350
|
+
if self._user_transform is None:
|
|
351
|
+
return self._transform.frozen()
|
|
352
|
+
else:
|
|
353
|
+
return (self._transform + self._user_transform).frozen()
|
|
354
|
+
|
|
355
|
+
def get_alt_path(self):
|
|
356
|
+
"""
|
|
357
|
+
Return a `.Path` for the alternate part of the marker.
|
|
358
|
+
|
|
359
|
+
For unfilled markers, this is *None*; for filled markers, this is the
|
|
360
|
+
area to be drawn with *markerfacecoloralt*.
|
|
361
|
+
"""
|
|
362
|
+
return self._alt_path
|
|
363
|
+
|
|
364
|
+
def get_alt_transform(self):
|
|
365
|
+
"""
|
|
366
|
+
Return the transform to be applied to the `.Path` from
|
|
367
|
+
`MarkerStyle.get_alt_path()`.
|
|
368
|
+
"""
|
|
369
|
+
if self._user_transform is None:
|
|
370
|
+
return self._alt_transform.frozen()
|
|
371
|
+
else:
|
|
372
|
+
return (self._alt_transform + self._user_transform).frozen()
|
|
373
|
+
|
|
374
|
+
def get_snap_threshold(self):
|
|
375
|
+
return self._snap_threshold
|
|
376
|
+
|
|
377
|
+
def get_user_transform(self):
|
|
378
|
+
"""Return user supplied part of marker transform."""
|
|
379
|
+
if self._user_transform is not None:
|
|
380
|
+
return self._user_transform.frozen()
|
|
381
|
+
|
|
382
|
+
def transformed(self, transform):
|
|
383
|
+
"""
|
|
384
|
+
Return a new version of this marker with the transform applied.
|
|
385
|
+
|
|
386
|
+
Parameters
|
|
387
|
+
----------
|
|
388
|
+
transform : `~matplotlib.transforms.Affine2D`
|
|
389
|
+
Transform will be combined with current user supplied transform.
|
|
390
|
+
"""
|
|
391
|
+
new_marker = MarkerStyle(self)
|
|
392
|
+
if new_marker._user_transform is not None:
|
|
393
|
+
new_marker._user_transform += transform
|
|
394
|
+
else:
|
|
395
|
+
new_marker._user_transform = transform
|
|
396
|
+
return new_marker
|
|
397
|
+
|
|
398
|
+
def rotated(self, *, deg=None, rad=None):
|
|
399
|
+
"""
|
|
400
|
+
Return a new version of this marker rotated by specified angle.
|
|
401
|
+
|
|
402
|
+
Parameters
|
|
403
|
+
----------
|
|
404
|
+
deg : float, optional
|
|
405
|
+
Rotation angle in degrees.
|
|
406
|
+
|
|
407
|
+
rad : float, optional
|
|
408
|
+
Rotation angle in radians.
|
|
409
|
+
|
|
410
|
+
.. note:: You must specify exactly one of deg or rad.
|
|
411
|
+
"""
|
|
412
|
+
if deg is None and rad is None:
|
|
413
|
+
raise ValueError('One of deg or rad is required')
|
|
414
|
+
if deg is not None and rad is not None:
|
|
415
|
+
raise ValueError('Only one of deg and rad can be supplied')
|
|
416
|
+
new_marker = MarkerStyle(self)
|
|
417
|
+
if new_marker._user_transform is None:
|
|
418
|
+
new_marker._user_transform = Affine2D()
|
|
419
|
+
|
|
420
|
+
if deg is not None:
|
|
421
|
+
new_marker._user_transform.rotate_deg(deg)
|
|
422
|
+
if rad is not None:
|
|
423
|
+
new_marker._user_transform.rotate(rad)
|
|
424
|
+
|
|
425
|
+
return new_marker
|
|
426
|
+
|
|
427
|
+
def scaled(self, sx, sy=None):
|
|
428
|
+
"""
|
|
429
|
+
Return new marker scaled by specified scale factors.
|
|
430
|
+
|
|
431
|
+
If *sy* is not given, the same scale is applied in both the *x*- and
|
|
432
|
+
*y*-directions.
|
|
433
|
+
|
|
434
|
+
Parameters
|
|
435
|
+
----------
|
|
436
|
+
sx : float
|
|
437
|
+
*X*-direction scaling factor.
|
|
438
|
+
sy : float, optional
|
|
439
|
+
*Y*-direction scaling factor.
|
|
440
|
+
"""
|
|
441
|
+
if sy is None:
|
|
442
|
+
sy = sx
|
|
443
|
+
|
|
444
|
+
new_marker = MarkerStyle(self)
|
|
445
|
+
_transform = new_marker._user_transform or Affine2D()
|
|
446
|
+
new_marker._user_transform = _transform.scale(sx, sy)
|
|
447
|
+
return new_marker
|
|
448
|
+
|
|
449
|
+
def _set_nothing(self):
|
|
450
|
+
self._filled = False
|
|
451
|
+
|
|
452
|
+
def _set_custom_marker(self, path):
|
|
453
|
+
rescale = np.max(np.abs(path.vertices)) # max of x's and y's.
|
|
454
|
+
self._transform = Affine2D().scale(0.5 / rescale)
|
|
455
|
+
self._path = path
|
|
456
|
+
|
|
457
|
+
def _set_path_marker(self):
|
|
458
|
+
self._set_custom_marker(self._marker)
|
|
459
|
+
|
|
460
|
+
def _set_vertices(self):
|
|
461
|
+
self._set_custom_marker(Path(self._marker))
|
|
462
|
+
|
|
463
|
+
def _set_tuple_marker(self):
|
|
464
|
+
marker = self._marker
|
|
465
|
+
if len(marker) == 2:
|
|
466
|
+
numsides, rotation = marker[0], 0.0
|
|
467
|
+
elif len(marker) == 3:
|
|
468
|
+
numsides, rotation = marker[0], marker[2]
|
|
469
|
+
symstyle = marker[1]
|
|
470
|
+
if symstyle == 0:
|
|
471
|
+
self._path = Path.unit_regular_polygon(numsides)
|
|
472
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
473
|
+
elif symstyle == 1:
|
|
474
|
+
self._path = Path.unit_regular_star(numsides)
|
|
475
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.bevel
|
|
476
|
+
elif symstyle == 2:
|
|
477
|
+
self._path = Path.unit_regular_asterisk(numsides)
|
|
478
|
+
self._filled = False
|
|
479
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.bevel
|
|
480
|
+
else:
|
|
481
|
+
raise ValueError(f"Unexpected tuple marker: {marker}")
|
|
482
|
+
self._transform = Affine2D().scale(0.5).rotate_deg(rotation)
|
|
483
|
+
|
|
484
|
+
def _set_mathtext_path(self):
|
|
485
|
+
"""
|
|
486
|
+
Draw mathtext markers '$...$' using `.TextPath` object.
|
|
487
|
+
|
|
488
|
+
Submitted by tcb
|
|
489
|
+
"""
|
|
490
|
+
from matplotlib_rs.text import TextPath
|
|
491
|
+
|
|
492
|
+
# again, the properties could be initialised just once outside
|
|
493
|
+
# this function
|
|
494
|
+
text = TextPath(xy=(0, 0), s=self.get_marker(),
|
|
495
|
+
usetex=mpl.rcParams['text.usetex'])
|
|
496
|
+
if len(text.vertices) == 0:
|
|
497
|
+
return
|
|
498
|
+
|
|
499
|
+
bbox = text.get_extents()
|
|
500
|
+
max_dim = max(bbox.width, bbox.height)
|
|
501
|
+
self._transform = (
|
|
502
|
+
Affine2D()
|
|
503
|
+
.translate(-bbox.xmin + 0.5 * -bbox.width, -bbox.ymin + 0.5 * -bbox.height)
|
|
504
|
+
.scale(1.0 / max_dim))
|
|
505
|
+
self._path = text
|
|
506
|
+
self._snap = False
|
|
507
|
+
|
|
508
|
+
def _half_fill(self):
|
|
509
|
+
return self.get_fillstyle() in self._half_fillstyles
|
|
510
|
+
|
|
511
|
+
def _set_circle(self, size=1.0):
|
|
512
|
+
self._transform = Affine2D().scale(0.5 * size)
|
|
513
|
+
self._snap_threshold = np.inf
|
|
514
|
+
if not self._half_fill():
|
|
515
|
+
self._path = Path.unit_circle()
|
|
516
|
+
else:
|
|
517
|
+
self._path = self._alt_path = Path.unit_circle_righthalf()
|
|
518
|
+
fs = self.get_fillstyle()
|
|
519
|
+
self._transform.rotate_deg(
|
|
520
|
+
{'right': 0, 'top': 90, 'left': 180, 'bottom': 270}[fs])
|
|
521
|
+
self._alt_transform = self._transform.frozen().rotate_deg(180.)
|
|
522
|
+
|
|
523
|
+
def _set_point(self):
|
|
524
|
+
self._set_circle(size=0.5)
|
|
525
|
+
|
|
526
|
+
def _set_pixel(self):
|
|
527
|
+
self._path = Path.unit_rectangle()
|
|
528
|
+
# Ideally, you'd want -0.5, -0.5 here, but then the snapping
|
|
529
|
+
# algorithm in the Agg backend will round this to a 2x2
|
|
530
|
+
# rectangle from (-1, -1) to (1, 1). By offsetting it
|
|
531
|
+
# slightly, we can force it to be (0, 0) to (1, 1), which both
|
|
532
|
+
# makes it only be a single pixel and places it correctly
|
|
533
|
+
# aligned to 1-width stroking (i.e. the ticks). This hack is
|
|
534
|
+
# the best of a number of bad alternatives, mainly because the
|
|
535
|
+
# backends are not aware of what marker is actually being used
|
|
536
|
+
# beyond just its path data.
|
|
537
|
+
self._transform = Affine2D().translate(-0.49999, -0.49999)
|
|
538
|
+
self._snap_threshold = None
|
|
539
|
+
|
|
540
|
+
_triangle_path = Path._create_closed([[0, 1], [-1, -1], [1, -1]])
|
|
541
|
+
# Going down halfway looks to small. Golden ratio is too far.
|
|
542
|
+
_triangle_path_u = Path._create_closed([[0, 1], [-3/5, -1/5], [3/5, -1/5]])
|
|
543
|
+
_triangle_path_d = Path._create_closed(
|
|
544
|
+
[[-3/5, -1/5], [3/5, -1/5], [1, -1], [-1, -1]])
|
|
545
|
+
_triangle_path_l = Path._create_closed([[0, 1], [0, -1], [-1, -1]])
|
|
546
|
+
_triangle_path_r = Path._create_closed([[0, 1], [0, -1], [1, -1]])
|
|
547
|
+
|
|
548
|
+
def _set_triangle(self, rot, skip):
|
|
549
|
+
self._transform = Affine2D().scale(0.5).rotate_deg(rot)
|
|
550
|
+
self._snap_threshold = 5.0
|
|
551
|
+
|
|
552
|
+
if not self._half_fill():
|
|
553
|
+
self._path = self._triangle_path
|
|
554
|
+
else:
|
|
555
|
+
mpaths = [self._triangle_path_u,
|
|
556
|
+
self._triangle_path_l,
|
|
557
|
+
self._triangle_path_d,
|
|
558
|
+
self._triangle_path_r]
|
|
559
|
+
|
|
560
|
+
fs = self.get_fillstyle()
|
|
561
|
+
if fs == 'top':
|
|
562
|
+
self._path = mpaths[(0 + skip) % 4]
|
|
563
|
+
self._alt_path = mpaths[(2 + skip) % 4]
|
|
564
|
+
elif fs == 'bottom':
|
|
565
|
+
self._path = mpaths[(2 + skip) % 4]
|
|
566
|
+
self._alt_path = mpaths[(0 + skip) % 4]
|
|
567
|
+
elif fs == 'left':
|
|
568
|
+
self._path = mpaths[(1 + skip) % 4]
|
|
569
|
+
self._alt_path = mpaths[(3 + skip) % 4]
|
|
570
|
+
else:
|
|
571
|
+
self._path = mpaths[(3 + skip) % 4]
|
|
572
|
+
self._alt_path = mpaths[(1 + skip) % 4]
|
|
573
|
+
|
|
574
|
+
self._alt_transform = self._transform
|
|
575
|
+
|
|
576
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
577
|
+
|
|
578
|
+
def _set_triangle_up(self):
|
|
579
|
+
return self._set_triangle(0.0, 0)
|
|
580
|
+
|
|
581
|
+
def _set_triangle_down(self):
|
|
582
|
+
return self._set_triangle(180.0, 2)
|
|
583
|
+
|
|
584
|
+
def _set_triangle_left(self):
|
|
585
|
+
return self._set_triangle(90.0, 3)
|
|
586
|
+
|
|
587
|
+
def _set_triangle_right(self):
|
|
588
|
+
return self._set_triangle(270.0, 1)
|
|
589
|
+
|
|
590
|
+
def _set_square(self):
|
|
591
|
+
self._transform = Affine2D().translate(-0.5, -0.5)
|
|
592
|
+
self._snap_threshold = 2.0
|
|
593
|
+
if not self._half_fill():
|
|
594
|
+
self._path = Path.unit_rectangle()
|
|
595
|
+
else:
|
|
596
|
+
# Build a bottom filled square out of two rectangles, one filled.
|
|
597
|
+
self._path = Path([[0.0, 0.0], [1.0, 0.0], [1.0, 0.5],
|
|
598
|
+
[0.0, 0.5], [0.0, 0.0]])
|
|
599
|
+
self._alt_path = Path([[0.0, 0.5], [1.0, 0.5], [1.0, 1.0],
|
|
600
|
+
[0.0, 1.0], [0.0, 0.5]])
|
|
601
|
+
fs = self.get_fillstyle()
|
|
602
|
+
rotate = {'bottom': 0, 'right': 90, 'top': 180, 'left': 270}[fs]
|
|
603
|
+
self._transform.rotate_deg(rotate)
|
|
604
|
+
self._alt_transform = self._transform
|
|
605
|
+
|
|
606
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
607
|
+
|
|
608
|
+
def _set_diamond(self):
|
|
609
|
+
self._transform = Affine2D().translate(-0.5, -0.5).rotate_deg(45)
|
|
610
|
+
self._snap_threshold = 5.0
|
|
611
|
+
if not self._half_fill():
|
|
612
|
+
self._path = Path.unit_rectangle()
|
|
613
|
+
else:
|
|
614
|
+
self._path = Path([[0, 0], [1, 0], [1, 1], [0, 0]])
|
|
615
|
+
self._alt_path = Path([[0, 0], [0, 1], [1, 1], [0, 0]])
|
|
616
|
+
fs = self.get_fillstyle()
|
|
617
|
+
rotate = {'right': 0, 'top': 90, 'left': 180, 'bottom': 270}[fs]
|
|
618
|
+
self._transform.rotate_deg(rotate)
|
|
619
|
+
self._alt_transform = self._transform
|
|
620
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
621
|
+
|
|
622
|
+
def _set_thin_diamond(self):
|
|
623
|
+
self._set_diamond()
|
|
624
|
+
self._transform.scale(0.6, 1.0)
|
|
625
|
+
|
|
626
|
+
def _set_pentagon(self):
|
|
627
|
+
self._transform = Affine2D().scale(0.5)
|
|
628
|
+
self._snap_threshold = 5.0
|
|
629
|
+
|
|
630
|
+
polypath = Path.unit_regular_polygon(5)
|
|
631
|
+
|
|
632
|
+
if not self._half_fill():
|
|
633
|
+
self._path = polypath
|
|
634
|
+
else:
|
|
635
|
+
verts = polypath.vertices
|
|
636
|
+
y = (1 + np.sqrt(5)) / 4.
|
|
637
|
+
top = Path(verts[[0, 1, 4, 0]])
|
|
638
|
+
bottom = Path(verts[[1, 2, 3, 4, 1]])
|
|
639
|
+
left = Path([verts[0], verts[1], verts[2], [0, -y], verts[0]])
|
|
640
|
+
right = Path([verts[0], verts[4], verts[3], [0, -y], verts[0]])
|
|
641
|
+
self._path, self._alt_path = {
|
|
642
|
+
'top': (top, bottom), 'bottom': (bottom, top),
|
|
643
|
+
'left': (left, right), 'right': (right, left),
|
|
644
|
+
}[self.get_fillstyle()]
|
|
645
|
+
self._alt_transform = self._transform
|
|
646
|
+
|
|
647
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
648
|
+
|
|
649
|
+
def _set_star(self):
|
|
650
|
+
self._transform = Affine2D().scale(0.5)
|
|
651
|
+
self._snap_threshold = 5.0
|
|
652
|
+
|
|
653
|
+
polypath = Path.unit_regular_star(5, innerCircle=0.381966)
|
|
654
|
+
|
|
655
|
+
if not self._half_fill():
|
|
656
|
+
self._path = polypath
|
|
657
|
+
else:
|
|
658
|
+
verts = polypath.vertices
|
|
659
|
+
top = Path(np.concatenate([verts[0:4], verts[7:10], verts[0:1]]))
|
|
660
|
+
bottom = Path(np.concatenate([verts[3:8], verts[3:4]]))
|
|
661
|
+
left = Path(np.concatenate([verts[0:6], verts[0:1]]))
|
|
662
|
+
right = Path(np.concatenate([verts[0:1], verts[5:10], verts[0:1]]))
|
|
663
|
+
self._path, self._alt_path = {
|
|
664
|
+
'top': (top, bottom), 'bottom': (bottom, top),
|
|
665
|
+
'left': (left, right), 'right': (right, left),
|
|
666
|
+
}[self.get_fillstyle()]
|
|
667
|
+
self._alt_transform = self._transform
|
|
668
|
+
|
|
669
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.bevel
|
|
670
|
+
|
|
671
|
+
def _set_hexagon1(self):
|
|
672
|
+
self._transform = Affine2D().scale(0.5)
|
|
673
|
+
self._snap_threshold = None
|
|
674
|
+
|
|
675
|
+
polypath = Path.unit_regular_polygon(6)
|
|
676
|
+
|
|
677
|
+
if not self._half_fill():
|
|
678
|
+
self._path = polypath
|
|
679
|
+
else:
|
|
680
|
+
verts = polypath.vertices
|
|
681
|
+
# not drawing inside lines
|
|
682
|
+
x = np.abs(np.cos(5 * np.pi / 6.))
|
|
683
|
+
top = Path(np.concatenate([[(-x, 0)], verts[[1, 0, 5]], [(x, 0)]]))
|
|
684
|
+
bottom = Path(np.concatenate([[(-x, 0)], verts[2:5], [(x, 0)]]))
|
|
685
|
+
left = Path(verts[0:4])
|
|
686
|
+
right = Path(verts[[0, 5, 4, 3]])
|
|
687
|
+
self._path, self._alt_path = {
|
|
688
|
+
'top': (top, bottom), 'bottom': (bottom, top),
|
|
689
|
+
'left': (left, right), 'right': (right, left),
|
|
690
|
+
}[self.get_fillstyle()]
|
|
691
|
+
self._alt_transform = self._transform
|
|
692
|
+
|
|
693
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
694
|
+
|
|
695
|
+
def _set_hexagon2(self):
|
|
696
|
+
self._transform = Affine2D().scale(0.5).rotate_deg(30)
|
|
697
|
+
self._snap_threshold = None
|
|
698
|
+
|
|
699
|
+
polypath = Path.unit_regular_polygon(6)
|
|
700
|
+
|
|
701
|
+
if not self._half_fill():
|
|
702
|
+
self._path = polypath
|
|
703
|
+
else:
|
|
704
|
+
verts = polypath.vertices
|
|
705
|
+
# not drawing inside lines
|
|
706
|
+
x, y = np.sqrt(3) / 4, 3 / 4.
|
|
707
|
+
top = Path(verts[[1, 0, 5, 4, 1]])
|
|
708
|
+
bottom = Path(verts[1:5])
|
|
709
|
+
left = Path(np.concatenate([
|
|
710
|
+
[(x, y)], verts[:3], [(-x, -y), (x, y)]]))
|
|
711
|
+
right = Path(np.concatenate([
|
|
712
|
+
[(x, y)], verts[5:2:-1], [(-x, -y)]]))
|
|
713
|
+
self._path, self._alt_path = {
|
|
714
|
+
'top': (top, bottom), 'bottom': (bottom, top),
|
|
715
|
+
'left': (left, right), 'right': (right, left),
|
|
716
|
+
}[self.get_fillstyle()]
|
|
717
|
+
self._alt_transform = self._transform
|
|
718
|
+
|
|
719
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
720
|
+
|
|
721
|
+
def _set_octagon(self):
|
|
722
|
+
self._transform = Affine2D().scale(0.5)
|
|
723
|
+
self._snap_threshold = 5.0
|
|
724
|
+
|
|
725
|
+
polypath = Path.unit_regular_polygon(8)
|
|
726
|
+
|
|
727
|
+
if not self._half_fill():
|
|
728
|
+
self._transform.rotate_deg(22.5)
|
|
729
|
+
self._path = polypath
|
|
730
|
+
else:
|
|
731
|
+
x = np.sqrt(2.) / 4.
|
|
732
|
+
self._path = self._alt_path = Path(
|
|
733
|
+
[[0, -1], [0, 1], [-x, 1], [-1, x],
|
|
734
|
+
[-1, -x], [-x, -1], [0, -1]])
|
|
735
|
+
fs = self.get_fillstyle()
|
|
736
|
+
self._transform.rotate_deg(
|
|
737
|
+
{'left': 0, 'bottom': 90, 'right': 180, 'top': 270}[fs])
|
|
738
|
+
self._alt_transform = self._transform.frozen().rotate_deg(180.0)
|
|
739
|
+
|
|
740
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
741
|
+
|
|
742
|
+
_line_marker_path = Path([[0.0, -1.0], [0.0, 1.0]])
|
|
743
|
+
|
|
744
|
+
def _set_vline(self):
|
|
745
|
+
self._transform = Affine2D().scale(0.5)
|
|
746
|
+
self._snap_threshold = 1.0
|
|
747
|
+
self._filled = False
|
|
748
|
+
self._path = self._line_marker_path
|
|
749
|
+
|
|
750
|
+
def _set_hline(self):
|
|
751
|
+
self._set_vline()
|
|
752
|
+
self._transform = self._transform.rotate_deg(90)
|
|
753
|
+
|
|
754
|
+
_tickhoriz_path = Path([[0.0, 0.0], [1.0, 0.0]])
|
|
755
|
+
|
|
756
|
+
def _set_tickleft(self):
|
|
757
|
+
self._transform = Affine2D().scale(-1.0, 1.0)
|
|
758
|
+
self._snap_threshold = 1.0
|
|
759
|
+
self._filled = False
|
|
760
|
+
self._path = self._tickhoriz_path
|
|
761
|
+
|
|
762
|
+
def _set_tickright(self):
|
|
763
|
+
self._transform = Affine2D().scale(1.0, 1.0)
|
|
764
|
+
self._snap_threshold = 1.0
|
|
765
|
+
self._filled = False
|
|
766
|
+
self._path = self._tickhoriz_path
|
|
767
|
+
|
|
768
|
+
_tickvert_path = Path([[-0.0, 0.0], [-0.0, 1.0]])
|
|
769
|
+
|
|
770
|
+
def _set_tickup(self):
|
|
771
|
+
self._transform = Affine2D().scale(1.0, 1.0)
|
|
772
|
+
self._snap_threshold = 1.0
|
|
773
|
+
self._filled = False
|
|
774
|
+
self._path = self._tickvert_path
|
|
775
|
+
|
|
776
|
+
def _set_tickdown(self):
|
|
777
|
+
self._transform = Affine2D().scale(1.0, -1.0)
|
|
778
|
+
self._snap_threshold = 1.0
|
|
779
|
+
self._filled = False
|
|
780
|
+
self._path = self._tickvert_path
|
|
781
|
+
|
|
782
|
+
_tri_path = Path([[0.0, 0.0], [0.0, -1.0],
|
|
783
|
+
[0.0, 0.0], [0.8, 0.5],
|
|
784
|
+
[0.0, 0.0], [-0.8, 0.5]],
|
|
785
|
+
[Path.MOVETO, Path.LINETO,
|
|
786
|
+
Path.MOVETO, Path.LINETO,
|
|
787
|
+
Path.MOVETO, Path.LINETO])
|
|
788
|
+
|
|
789
|
+
def _set_tri_down(self):
|
|
790
|
+
self._transform = Affine2D().scale(0.5)
|
|
791
|
+
self._snap_threshold = 5.0
|
|
792
|
+
self._filled = False
|
|
793
|
+
self._path = self._tri_path
|
|
794
|
+
|
|
795
|
+
def _set_tri_up(self):
|
|
796
|
+
self._set_tri_down()
|
|
797
|
+
self._transform = self._transform.rotate_deg(180)
|
|
798
|
+
|
|
799
|
+
def _set_tri_left(self):
|
|
800
|
+
self._set_tri_down()
|
|
801
|
+
self._transform = self._transform.rotate_deg(270)
|
|
802
|
+
|
|
803
|
+
def _set_tri_right(self):
|
|
804
|
+
self._set_tri_down()
|
|
805
|
+
self._transform = self._transform.rotate_deg(90)
|
|
806
|
+
|
|
807
|
+
_caret_path = Path([[-1.0, 1.5], [0.0, 0.0], [1.0, 1.5]])
|
|
808
|
+
|
|
809
|
+
def _set_caretdown(self):
|
|
810
|
+
self._transform = Affine2D().scale(0.5)
|
|
811
|
+
self._snap_threshold = 3.0
|
|
812
|
+
self._filled = False
|
|
813
|
+
self._path = self._caret_path
|
|
814
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
815
|
+
|
|
816
|
+
def _set_caretup(self):
|
|
817
|
+
self._set_caretdown()
|
|
818
|
+
self._transform = self._transform.rotate_deg(180)
|
|
819
|
+
|
|
820
|
+
def _set_caretleft(self):
|
|
821
|
+
self._set_caretdown()
|
|
822
|
+
self._transform = self._transform.rotate_deg(270)
|
|
823
|
+
|
|
824
|
+
def _set_caretright(self):
|
|
825
|
+
self._set_caretdown()
|
|
826
|
+
self._transform = self._transform.rotate_deg(90)
|
|
827
|
+
|
|
828
|
+
_caret_path_base = Path([[-1.0, 0.0], [0.0, -1.5], [1.0, 0]])
|
|
829
|
+
|
|
830
|
+
def _set_caretdownbase(self):
|
|
831
|
+
self._set_caretdown()
|
|
832
|
+
self._path = self._caret_path_base
|
|
833
|
+
|
|
834
|
+
def _set_caretupbase(self):
|
|
835
|
+
self._set_caretdownbase()
|
|
836
|
+
self._transform = self._transform.rotate_deg(180)
|
|
837
|
+
|
|
838
|
+
def _set_caretleftbase(self):
|
|
839
|
+
self._set_caretdownbase()
|
|
840
|
+
self._transform = self._transform.rotate_deg(270)
|
|
841
|
+
|
|
842
|
+
def _set_caretrightbase(self):
|
|
843
|
+
self._set_caretdownbase()
|
|
844
|
+
self._transform = self._transform.rotate_deg(90)
|
|
845
|
+
|
|
846
|
+
_plus_path = Path([[-1.0, 0.0], [1.0, 0.0],
|
|
847
|
+
[0.0, -1.0], [0.0, 1.0]],
|
|
848
|
+
[Path.MOVETO, Path.LINETO,
|
|
849
|
+
Path.MOVETO, Path.LINETO])
|
|
850
|
+
|
|
851
|
+
def _set_plus(self):
|
|
852
|
+
self._transform = Affine2D().scale(0.5)
|
|
853
|
+
self._snap_threshold = 1.0
|
|
854
|
+
self._filled = False
|
|
855
|
+
self._path = self._plus_path
|
|
856
|
+
|
|
857
|
+
_x_path = Path([[-1.0, -1.0], [1.0, 1.0],
|
|
858
|
+
[-1.0, 1.0], [1.0, -1.0]],
|
|
859
|
+
[Path.MOVETO, Path.LINETO,
|
|
860
|
+
Path.MOVETO, Path.LINETO])
|
|
861
|
+
|
|
862
|
+
def _set_x(self):
|
|
863
|
+
self._transform = Affine2D().scale(0.5)
|
|
864
|
+
self._snap_threshold = 3.0
|
|
865
|
+
self._filled = False
|
|
866
|
+
self._path = self._x_path
|
|
867
|
+
|
|
868
|
+
_plus_filled_path = Path._create_closed(np.array([
|
|
869
|
+
(-1, -3), (+1, -3), (+1, -1), (+3, -1), (+3, +1), (+1, +1),
|
|
870
|
+
(+1, +3), (-1, +3), (-1, +1), (-3, +1), (-3, -1), (-1, -1)]) / 6)
|
|
871
|
+
_plus_filled_path_t = Path._create_closed(np.array([
|
|
872
|
+
(+3, 0), (+3, +1), (+1, +1), (+1, +3),
|
|
873
|
+
(-1, +3), (-1, +1), (-3, +1), (-3, 0)]) / 6)
|
|
874
|
+
|
|
875
|
+
def _set_plus_filled(self):
|
|
876
|
+
self._transform = Affine2D()
|
|
877
|
+
self._snap_threshold = 5.0
|
|
878
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
879
|
+
if not self._half_fill():
|
|
880
|
+
self._path = self._plus_filled_path
|
|
881
|
+
else:
|
|
882
|
+
# Rotate top half path to support all partitions
|
|
883
|
+
self._path = self._alt_path = self._plus_filled_path_t
|
|
884
|
+
fs = self.get_fillstyle()
|
|
885
|
+
self._transform.rotate_deg(
|
|
886
|
+
{'top': 0, 'left': 90, 'bottom': 180, 'right': 270}[fs])
|
|
887
|
+
self._alt_transform = self._transform.frozen().rotate_deg(180)
|
|
888
|
+
|
|
889
|
+
_x_filled_path = Path._create_closed(np.array([
|
|
890
|
+
(-1, -2), (0, -1), (+1, -2), (+2, -1), (+1, 0), (+2, +1),
|
|
891
|
+
(+1, +2), (0, +1), (-1, +2), (-2, +1), (-1, 0), (-2, -1)]) / 4)
|
|
892
|
+
_x_filled_path_t = Path._create_closed(np.array([
|
|
893
|
+
(+1, 0), (+2, +1), (+1, +2), (0, +1),
|
|
894
|
+
(-1, +2), (-2, +1), (-1, 0)]) / 4)
|
|
895
|
+
|
|
896
|
+
def _set_x_filled(self):
|
|
897
|
+
self._transform = Affine2D()
|
|
898
|
+
self._snap_threshold = 5.0
|
|
899
|
+
self._joinstyle = self._user_joinstyle or JoinStyle.miter
|
|
900
|
+
if not self._half_fill():
|
|
901
|
+
self._path = self._x_filled_path
|
|
902
|
+
else:
|
|
903
|
+
# Rotate top half path to support all partitions
|
|
904
|
+
self._path = self._alt_path = self._x_filled_path_t
|
|
905
|
+
fs = self.get_fillstyle()
|
|
906
|
+
self._transform.rotate_deg(
|
|
907
|
+
{'top': 0, 'left': 90, 'bottom': 180, 'right': 270}[fs])
|
|
908
|
+
self._alt_transform = self._transform.frozen().rotate_deg(180)
|